add state check assert routine

This commit is contained in:
alex.sharov 2021-08-28 14:25:33 +07:00
parent b0d24509ac
commit b8b6f5d6a3

View File

@ -772,6 +772,9 @@ func (b *ByNonce) delete(mt *metaTx) {
}
}
func (b *ByNonce) replaceOrInsert(mt *metaTx) *metaTx {
if ASSERT && (mt == nil || mt.Tx == nil || mt.Tx.senderID == 0) {
panic("must never happen")
}
it := b.tree.ReplaceOrInsert(&sortByNonce{mt})
if it != nil {
return it.(*sortByNonce).metaTx