From 4c52baafbc7e066a48807ac2d3f862e43979501c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 16 Jul 2024 01:57:54 -0500 Subject: [PATCH] added more logs to state dump script --- state-dump/dump.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/state-dump/dump.go b/state-dump/dump.go index 39cb98a8..1727cb3e 100644 --- a/state-dump/dump.go +++ b/state-dump/dump.go @@ -95,10 +95,16 @@ func main() { iter := store.Iterator(nil, nil) // Dump all keys as write operations. - count := 0 + exported := 0 + processed := 0 for ; iter.Valid(); iter.Next() { key := iter.Key() + processed++ + if processed%100000 == 0 { + fmt.Printf("Processed %d keys\n", processed) + } + // Make sure key is for the given address. Different stores have the address // in a different position. if len(addressesBech32Data) > 0 { @@ -156,11 +162,14 @@ func main() { panic(err) } - count++ - if count%5000 == 0 { - fmt.Println("Exported", count, "keys") + exported++ + if exported == 1 { + fmt.Println("Exported first key") + } + if exported%5000 == 0 { + fmt.Println("Exported", exported, "keys") } } - fmt.Println("Exported", count, "keys") + fmt.Println("Exported", exported, "keys") }