From 35effe459f62c989dc414b6981c3b3b80c40a449 Mon Sep 17 00:00:00 2001 From: junderw Date: Thu, 30 Nov 2023 01:59:48 -0700 Subject: [PATCH] Feature: Log every 10k blocks to help show progress during initial sync --- src/new_index/schema.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/new_index/schema.rs b/src/new_index/schema.rs index 1446d682..7efc9099 100644 --- a/src/new_index/schema.rs +++ b/src/new_index/schema.rs @@ -329,7 +329,12 @@ impl Indexer { .added_blockhashes .write() .unwrap() - .extend(blocks.iter().map(|b| b.entry.hash())); + .extend(blocks.iter().map(|b| { + if b.entry.height() % 10_000 == 0 { + info!("Tx indexing is up to height={}", b.entry.height()); + } + b.entry.hash() + })); } fn index(&self, blocks: &[BlockEntry]) { @@ -342,6 +347,9 @@ impl Indexer { let _timer = self.start_timer("index_process"); let added_blockhashes = self.store.added_blockhashes.read().unwrap(); for b in blocks { + if b.entry.height() % 10_000 == 0 { + info!("History indexing is up to height={}", b.entry.height()); + } let blockhash = b.entry.hash(); // TODO: replace by lookup into txstore_db? if !added_blockhashes.contains(blockhash) {