From 7a48420c8f86c66f9b98e3e9952e4ee3b5ac4e54 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Wed, 11 Aug 2021 11:23:48 +0700 Subject: [PATCH] evict --- txpool/pool.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/txpool/pool.go b/txpool/pool.go index 1f7b666eb..4ad2b3636 100644 --- a/txpool/pool.go +++ b/txpool/pool.go @@ -337,20 +337,22 @@ func (p *TxPool) OnNewBlock(tx kv.Tx, stateChanges map[string]senderInfo, unwind } } - // evict sendersInfo without txs - if len(p.senderIDs) > MaxSendersInfoCache { - for i := range p.senderInfo { - if p.senderInfo[i].txNonce2Tx.Len() > 0 { - continue - } - for addr, id := range p.senderIDs { - if id == i { - delete(p.senderIDs, addr) + /* + // evict sendersInfo without txs + if len(p.senderIDs) > MaxSendersInfoCache { + for i := range p.senderInfo { + if p.senderInfo[i].txNonce2Tx.Len() > 0 { + continue } + for addr, id := range p.senderIDs { + if id == i { + delete(p.senderIDs, addr) + } + } + delete(p.senderInfo, i) } - delete(p.senderInfo, i) } - } + */ return nil }