Skip to content

Commit e52e9c2

Browse files
committed
callbacks: always show progress
1 parent fe250a2 commit e52e9c2

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

src/callbacks/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ pub trait Callback {
2222

2323
/// Gets called if the parser has finished and all blocks are handled
2424
fn on_complete(&mut self, block_height: u64) -> anyhow::Result<()>;
25-
26-
/// Can be used to toggle whether the progress should be shown for specific callbacks or not
27-
fn show_progress(&self) -> bool {
28-
true
29-
}
3025
}
3126

3227
pub struct UnspentValue {

src/callbacks/opreturn.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,4 @@ impl Callback for OpReturn {
5454
fn on_complete(&mut self, _: u64) -> anyhow::Result<()> {
5555
Ok(())
5656
}
57-
58-
fn show_progress(&self) -> bool {
59-
false
60-
}
6157
}

src/parser/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ impl BlockchainParser {
8383
fn on_block(&mut self, block: &bitcoin::Block, height: u64) -> anyhow::Result<()> {
8484
self.callback.on_block(block, height)?;
8585
tracing::trace!(target: "parser", "on_block(height={}) called", height);
86-
if self.callback.show_progress() {
87-
self.print_progress(height);
88-
}
86+
self.print_progress(height);
8987
Ok(())
9088
}
9189

0 commit comments

Comments
 (0)