From 735c0966d0311499dad659561c0af8f8b2962418 Mon Sep 17 00:00:00 2001 From: BananaLF <864685021@qq.com> Date: Mon, 11 Dec 2023 11:21:55 +0800 Subject: [PATCH] optimize code --- libs/tendermint/mempool/clist_mempool.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/tendermint/mempool/clist_mempool.go b/libs/tendermint/mempool/clist_mempool.go index dde2eea2ed..bf63262b20 100644 --- a/libs/tendermint/mempool/clist_mempool.go +++ b/libs/tendermint/mempool/clist_mempool.go @@ -322,6 +322,9 @@ func (mem *CListMempool) validatePeerCount(txInfo TxInfo) error { } func (mem *CListMempool) resetPeerCount() { + if cfg.DynamicConfig.GetMaxTxLimitPerPeer() == 0 { + return + } mem.peersTxCountMtx.Lock() defer mem.peersTxCountMtx.Unlock() for key := range mem.peersTxCount {