This commit is contained in:
alex.sharov 2021-08-11 11:23:48 +07:00
parent d9dae8199b
commit 7a48420c8f

View File

@ -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 { // evict sendersInfo without txs
for i := range p.senderInfo { if len(p.senderIDs) > MaxSendersInfoCache {
if p.senderInfo[i].txNonce2Tx.Len() > 0 { for i := range p.senderInfo {
continue if p.senderInfo[i].txNonce2Tx.Len() > 0 {
} continue
for addr, id := range p.senderIDs {
if id == i {
delete(p.senderIDs, addr)
} }
for addr, id := range p.senderIDs {
if id == i {
delete(p.senderIDs, addr)
}
}
delete(p.senderInfo, i)
} }
delete(p.senderInfo, i)
} }
} */
return nil return nil
} }