From 27c523dccbe7f2f577868ee871b0042c1fef9a53 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Wed, 6 Jul 2022 20:17:56 +0200 Subject: [PATCH] mempool: return error when mempool is full and inbound tx is rejected (#8942) Addresses: https://github.com/tendermint/tendermint/issues/8928 --- internal/mempool/mempool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/mempool/mempool.go b/internal/mempool/mempool.go index caee97ff8..2398180fc 100644 --- a/internal/mempool/mempool.go +++ b/internal/mempool/mempool.go @@ -540,7 +540,7 @@ func (txmp *TxMempool) initTxCallback(wtx *WrappedTx, res *abci.ResponseCheckTx, ) if len(evictTxs) == 0 { // No room for the new incoming transaction so we just remove it from - // the cache. + // the cache and return an error to the user. txmp.cache.Remove(wtx.tx) txmp.logger.Error( "rejected incoming good transaction; mempool full", @@ -548,7 +548,7 @@ func (txmp *TxMempool) initTxCallback(wtx *WrappedTx, res *abci.ResponseCheckTx, "err", err.Error(), ) txmp.metrics.RejectedTxs.Add(1) - return nil + return err } // evict an existing transaction(s)