From e7b6bc14f2f82d6dafeaf914b5bbe4a8de1b1809 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Sat, 28 Aug 2021 09:27:17 +0700 Subject: [PATCH] add state check assert routine --- txpool/pool.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/txpool/pool.go b/txpool/pool.go index 822809ce8..ce97d3bab 100644 --- a/txpool/pool.go +++ b/txpool/pool.go @@ -1036,6 +1036,11 @@ func (p *TxPool) flush(tx kv.RwTx, senders *SendersCache) error { if metaTx.Tx.rlp == nil { continue } + if ASSERT { + if p.txNonce2Tx.count(metaTx.Tx.senderID) == 0 { + panic("here i am") + } + } v = ensureEnoughSize(v, 8+8+len(metaTx.Tx.rlp)) binary.BigEndian.PutUint64(v, metaTx.Tx.senderID) binary.BigEndian.PutUint64(v[8:], 0) // block num - timestamp