mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-01 00:31:21 +00:00
save
This commit is contained in:
parent
ee04be5cf3
commit
7510505f39
@ -161,16 +161,12 @@ func (sc *SendersCache) evict() int {
|
||||
}
|
||||
|
||||
count := 0
|
||||
for i := range sc.senderInfo {
|
||||
if sc.senderInfo[i].txNonce2Tx.Len() > 0 {
|
||||
for addr, id := range sc.senderIDs {
|
||||
if sc.senderInfo[id].txNonce2Tx.Len() > 0 {
|
||||
continue
|
||||
}
|
||||
for addr, id := range sc.senderIDs {
|
||||
if id == i {
|
||||
delete(sc.senderIDs, addr)
|
||||
}
|
||||
}
|
||||
delete(sc.senderInfo, i)
|
||||
delete(sc.senderInfo, id)
|
||||
delete(sc.senderIDs, addr)
|
||||
count++
|
||||
}
|
||||
return count
|
||||
@ -548,6 +544,11 @@ func (p *TxPool) OnNewBlock(coreDB kv.Tx, stateChanges map[string]senderInfo, un
|
||||
}
|
||||
}
|
||||
|
||||
count := senders.evict()
|
||||
if count > 0 {
|
||||
log.Debug("evicted senders", "amount", count)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
func (p *TxPool) flushIsLocalHistory(tx kv.RwTx) error {
|
||||
@ -1027,11 +1028,6 @@ func BroadcastLoop(ctx context.Context, db kv.RwDB, p *TxPool, senders *SendersC
|
||||
case <-logEvery.C:
|
||||
p.logStats()
|
||||
case <-evictSendersEvery.C:
|
||||
// evict sendersInfo without txs
|
||||
count := senders.evict()
|
||||
if count > 0 {
|
||||
log.Debug("evicted senders", "amount", count)
|
||||
}
|
||||
if db != nil {
|
||||
if err := db.Update(ctx, func(tx kv.RwTx) error {
|
||||
return p.flushIsLocalHistory(tx)
|
||||
|
Loading…
Reference in New Issue
Block a user