From 55990ec6d2557307497d14e302ee92b8f2081d83 Mon Sep 17 00:00:00 2001 From: "Kim, JinSan" Date: Tue, 5 Jan 2021 14:38:04 +0900 Subject: [PATCH] chore: revise to remove redundant `isFull()` --- mempool/clist_mempool.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/mempool/clist_mempool.go b/mempool/clist_mempool.go index 69d8dbab4..98d7b2203 100644 --- a/mempool/clist_mempool.go +++ b/mempool/clist_mempool.go @@ -223,10 +223,6 @@ func (mem *CListMempool) CheckTx(tx types.Tx, cb func(*abci.Response), txInfo Tx txSize := len(tx) - if err := mem.isFull(txSize); err != nil { - return err - } - // The size of the corresponding amino-encoded TxMessage // can't be larger than the maxMsgSize, otherwise we can't // relay it to peers. @@ -367,22 +363,6 @@ func (mem *CListMempool) removeTx(tx types.Tx, elem *clist.CElement, removeFromC } } -func (mem *CListMempool) isFull(txSize int) error { - var ( - memSize = mem.Size() - txsBytes = mem.TxsBytes() - ) - - if memSize >= mem.config.Size || int64(txSize)+txsBytes > mem.config.MaxTxsBytes { - return ErrMempoolIsFull{ - memSize, mem.config.Size, - txsBytes, mem.config.MaxTxsBytes, - } - } - - return nil -} - func (mem *CListMempool) reserve(txSize int64) error { mem.reservedMtx.Lock() defer mem.reservedMtx.Unlock()