add state check assert routine

This commit is contained in:
alex.sharov 2021-08-27 10:01:44 +07:00
parent 26f543dff8
commit fbe84f8d5f

View File

@ -568,6 +568,13 @@ func (sc *SendersCache) flush(tx kv.RwTx, byNonce *ByNonce) error {
if byNonce.count(binary.BigEndian.Uint64(id)) > 0 {
return nil
}
tx.ForEach(kv.PooledTransaction, nil, func(k, v []byte) error {
senderID := binary.BigEndian.Uint64(v[:8])
if senderID == binary.BigEndian.Uint64(id) {
panic("why?")
}
return nil
})
if err := tx.Delete(kv.PooledSenderID, addr, nil); err != nil {
return err
}