From cf7a346d163434b47841e5ba79497c1c0aacb897 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Fri, 27 Aug 2021 16:44:49 +0700 Subject: [PATCH] add state check assert routine --- txpool/pool.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/txpool/pool.go b/txpool/pool.go index 271a37bc4..71e9f13a8 100644 --- a/txpool/pool.go +++ b/txpool/pool.go @@ -1131,12 +1131,9 @@ func (p *TxPool) fromDB(ctx context.Context, tx kv.RwTx, coreTx kv.Tx) error { return err } if len(vv) == 0 { - tx.ForEach(kv.PooledSenderIDToAdress, nil, func(kkk, vvvv []byte) error { - if bytes.HasPrefix(kkk, v[:6]) { - fmt.Printf("found:%x,%x\n", kkk, vvvv) - } - return nil - }) + cc, _ := tx.Cursor(kv.PooledSenderIDToAdress) + last, lastAddr, _ := cc.Last() + fmt.Printf("last: %d,%x\n", binary.BigEndian.Uint64(last), lastAddr) fmt.Printf("now: %d\n", p.senders.senderID) fmt.Printf("not foundd: %d,%x,%x,%x\n", binary.BigEndian.Uint64(v[:8]), k, v, vv) panic("no-no")