Skip to content

Commit c755a1c

Browse files
committed
fix rechecktx idling when mempool is empty
1 parent 74157e3 commit c755a1c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

mempool/clist_mempool.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -706,10 +706,6 @@ func (mem *CListMempool) purgeExpiredTxs(blockHeight int64, blockTime time.Time)
706706
func (mem *CListMempool) recheckTxs() {
707707
mem.logger.Debug("recheck txs", "height", mem.height.Load(), "num-txs", mem.Size())
708708

709-
if mem.Size() <= 0 {
710-
return
711-
}
712-
713709
for e := mem.txs.Front(); e != nil; e = e.Next() {
714710
memTx := e.Value.(*mempoolTx)
715711
// If this transaction is Cosmos transaction containing a
@@ -721,6 +717,11 @@ func (mem *CListMempool) recheckTxs() {
721717
}
722718
}
723719
}
720+
721+
if mem.Size() <= 0 {
722+
return
723+
}
724+
724725
mem.recheck.init(mem.txs.Front(), mem.txs.Back())
725726

726727
// NOTE: globalCb may be called concurrently, but CheckTx cannot be executed concurrently

0 commit comments

Comments
 (0)