From d9dae8199b570dd11f694af6c17ad0619e1931b3 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Wed, 11 Aug 2021 11:22:35 +0700 Subject: [PATCH] evic --- txpool/pool.go | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/txpool/pool.go b/txpool/pool.go index 4ad2b3636..1f7b666eb 100644 --- a/txpool/pool.go +++ b/txpool/pool.go @@ -337,22 +337,20 @@ 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) - } - } - delete(p.senderInfo, i) + // 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) } - */ + } return nil }