From 0e5e18d7b9aef3f6c9a0234fb3d536c8c46ad49f Mon Sep 17 00:00:00 2001 From: Evan Han Date: Fri, 6 May 2022 21:29:22 +0800 Subject: [PATCH] Merge PR: fix cosmos tx when enable pending pool feature (#1991) * fix cosmos tx when enable pending pool feature * add comments --- libs/tendermint/mempool/clist_mempool.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/tendermint/mempool/clist_mempool.go b/libs/tendermint/mempool/clist_mempool.go index 39cf4078e9..39e409536d 100644 --- a/libs/tendermint/mempool/clist_mempool.go +++ b/libs/tendermint/mempool/clist_mempool.go @@ -528,7 +528,9 @@ func (mem *CListMempool) addPendingTx(memTx *mempoolTx) error { if ok { expectedNonce = pendingNonce + 1 } - if memTx.realTx.GetNonce() == expectedNonce { + txNonce := memTx.realTx.GetNonce() + // cosmos tx does not support pending pool, so here must check whether txNonce is 0 + if txNonce == 0 || txNonce == expectedNonce { err := mem.addTx(memTx) if err == nil { go mem.consumePendingTx(memTx.from, memTx.realTx.GetNonce()+1)