From b8b6f5d6a3d92bddf608a3667755c457f8799b96 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Sat, 28 Aug 2021 14:25:33 +0700 Subject: [PATCH] add state check assert routine --- txpool/pool.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/txpool/pool.go b/txpool/pool.go index 133f7101a..16b7ac001 100644 --- a/txpool/pool.go +++ b/txpool/pool.go @@ -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