add state check assert routine

This commit is contained in:
alex.sharov 2021-08-27 10:24:50 +07:00
parent 0396127a54
commit fe00a55513

View File

@ -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)