mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-08 12:01:20 +00:00
add state check assert routine
This commit is contained in:
parent
afdb0c7598
commit
8673a30ea6
@ -572,6 +572,7 @@ func (sc *SendersCache) flush(tx kv.RwTx, byNonce *ByNonce) error {
|
||||
if byNonce.count(binary.BigEndian.Uint64(id)) > 0 {
|
||||
return nil
|
||||
}
|
||||
if ASSERT {
|
||||
tx.ForEach(kv.PooledTransaction, nil, func(k, v []byte) error {
|
||||
senderID := binary.BigEndian.Uint64(v[:8])
|
||||
if senderID == binary.BigEndian.Uint64(id) {
|
||||
@ -579,6 +580,7 @@ func (sc *SendersCache) flush(tx kv.RwTx, byNonce *ByNonce) error {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
if err := tx.Delete(kv.PooledSenderID, addr, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -589,6 +591,7 @@ func (sc *SendersCache) flush(tx kv.RwTx, byNonce *ByNonce) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if ASSERT {
|
||||
tx.ForEach(kv.PooledTransaction, nil, func(k, v []byte) error {
|
||||
vv, err := tx.GetOne(kv.PooledSenderIDToAdress, v[:8])
|
||||
if err != nil {
|
||||
@ -600,6 +603,7 @@ func (sc *SendersCache) flush(tx kv.RwTx, byNonce *ByNonce) error {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
i++
|
||||
return nil
|
||||
}); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user