mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-07 11:32:20 +00:00
add state check assert routine
This commit is contained in:
parent
0396127a54
commit
fe00a55513
@ -587,21 +587,23 @@ func (sc *SendersCache) flush(tx kv.RwTx, byNonce *ByNonce) error {
|
||||
if err := tx.Delete(kv.PooledSender, id, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
tx.ForEach(kv.PooledTransaction, nil, func(k, v []byte) error {
|
||||
vv, err := tx.GetOne(kv.PooledSenderIDToAdress, v[:8])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(vv) == 0 {
|
||||
fmt.Printf("no: %x,%x\n", id, addr)
|
||||
panic("no-no")
|
||||
}
|
||||
return nil
|
||||
})
|
||||
i++
|
||||
return nil
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
tx.ForEach(kv.PooledTransaction, nil, func(k, v []byte) error {
|
||||
vv, err := tx.GetOne(kv.PooledSenderIDToAdress, v[:8])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(vv) == 0 {
|
||||
panic("no-no")
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
fmt.Printf("evicted: %d\n", i)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user