Skip to content

Commit 9c2df7f

Browse files
committed
parser: print progress in main loop
1 parent 8bd3ebf commit 9c2df7f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/parser/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ impl BlockchainParser {
5151
while let Some(header) = self.chain_storage.get_header(self.cur_height) {
5252
Self::on_header(&header, self.cur_height);
5353
let block = self.chain_storage.get_block(self.cur_height).unwrap();
54-
self.on_block(&block, self.cur_height);
54+
Self::on_block(&block, self.cur_height);
55+
self.print_progress(self.cur_height);
5556
self.cur_height += 1;
5657
}
5758
self.on_complete(self.cur_height.saturating_sub(1));
@@ -77,9 +78,8 @@ impl BlockchainParser {
7778
tracing::trace!(target: "parser", "on_header(height={}) called", height);
7879
}
7980

80-
fn on_block(&mut self, _block: &bitcoin::Block, height: u64) {
81+
fn on_block(_block: &bitcoin::Block, height: u64) {
8182
tracing::trace!(target: "parser", "on_block(height={}) called", height);
82-
self.print_progress(height);
8383
}
8484

8585
fn on_complete(&mut self, height: u64) {

0 commit comments

Comments
 (0)