From 0d45fae6866420dd85876c8b0d432bd914d44ed4 Mon Sep 17 00:00:00 2001 From: Jin Date: Wed, 15 Nov 2023 12:46:59 +0800 Subject: [PATCH] BUG:About foreach utxo --- database/rawdb/accessors_chain.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/database/rawdb/accessors_chain.go b/database/rawdb/accessors_chain.go index 47787430..176b4ea8 100644 --- a/database/rawdb/accessors_chain.go +++ b/database/rawdb/accessors_chain.go @@ -284,7 +284,8 @@ func ForeachUtxo(db ethdb.KeyValueStore, fn func(opd []byte, data []byte) error) defer it.Release() for it.Next() { - err := fn(it.Key(), it.Value()) + op := it.Key()[len(utxoPrefix):] + err := fn(op, it.Value()) if err != nil { return err }