diff --git a/internal/mempool/mempool.go b/internal/mempool/mempool.go index c9a5ab696..1b5262246 100644 --- a/internal/mempool/mempool.go +++ b/internal/mempool/mempool.go @@ -177,7 +177,9 @@ func (txmp *TxMempool) Unlock() { // Size returns the number of valid transactions in the mempool. It is // thread-safe. func (txmp *TxMempool) Size() int { - return txmp.txStore.Size() + txmp.pendingTxs.Size() + txSize := txmp.txStore.Size() + pendingSize := txmp.pendingTxs.Size() + return txSize + pendingSize } // SizeBytes return the total sum in bytes of all the valid transactions in the diff --git a/internal/mempool/tx.go b/internal/mempool/tx.go index e5fd7b16f..c74872054 100644 --- a/internal/mempool/tx.go +++ b/internal/mempool/tx.go @@ -343,7 +343,7 @@ func (p *PendingTxs) popTxsAtIndices(indices []int) { newTxs = append(newTxs, p.txs[start:idx]...) start = idx } - newTxs = append(newTxs, p.txs[indices[len(indices)-1]:]...) + newTxs = append(newTxs, p.txs[start+1:]...) p.txs = newTxs } diff --git a/internal/rpc/core/mempool.go b/internal/rpc/core/mempool.go index 12fa2d339..917e00b47 100644 --- a/internal/rpc/core/mempool.go +++ b/internal/rpc/core/mempool.go @@ -149,7 +149,6 @@ func (env *Environment) BroadcastTxCommit(ctx context.Context, req *coretypes.Re // More: https://docs.tendermint.com/master/rpc/#/Info/unconfirmed_txs func (env *Environment) UnconfirmedTxs(ctx context.Context, req *coretypes.RequestUnconfirmedTxs) (*coretypes.ResultUnconfirmedTxs, error) { totalCount := env.Mempool.Size() - fmt.Printf("EVMTEST mempool size: %d\n", totalCount) perPage := env.validatePerPage(req.PerPage.IntPtr()) page, err := validatePage(req.Page.IntPtr(), perPage, totalCount) if err != nil { @@ -161,7 +160,6 @@ func (env *Environment) UnconfirmedTxs(ctx context.Context, req *coretypes.Reque txs := env.Mempool.ReapMaxTxs(skipCount + tmmath.MinInt(perPage, totalCount-skipCount)) result := txs[skipCount:] - fmt.Printf("EVMTEST unconfirmed tx result count: %d, skipping %d\n", len(result), skipCount) return &coretypes.ResultUnconfirmedTxs{ Count: len(result), Total: totalCount,