From 0e42c04b6c938895781a9bc49f2ce8cf38ed9d87 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Fri, 27 Aug 2021 17:18:29 +0700 Subject: [PATCH] add state check assert routine --- txpool/pool.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/txpool/pool.go b/txpool/pool.go index c951418dd..e78df3d49 100644 --- a/txpool/pool.go +++ b/txpool/pool.go @@ -640,12 +640,11 @@ func (sc *SendersCache) flush(tx kv.RwTx, byNonce *ByNonce, sendersWithoutTransa return err } if len(vv) == 0 { - tx.ForEach(kv.PooledSenderIDToAdress, nil, func(k, vvvv []byte) error { - if bytes.HasPrefix(k, v[:7]) { - fmt.Printf("found:%x,%x\n", k, 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", sc.senderID) + fmt.Printf("not foundd: %d,%x,%x,%x\n", binary.BigEndian.Uint64(v[:8]), k, v, vv) fmt.Printf("aa: %x,%x,%x\n", k, v, vv) panic("no-no") }