Skip to content

Commit 0baa9d6

Browse files
committed
feat: log difficulty
1 parent ea4cfa7 commit 0baa9d6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/mine.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,22 @@ impl Miner {
116116
if nonce % 100 == 0 {
117117
let global_best_difficulty = *global_best_difficulty.read().unwrap();
118118
if timer.elapsed().as_secs().ge(&cutoff_time) {
119+
if i == 0 {
120+
progress_bar.set_message(format!(
121+
"Mining... ({} / {} difficulty)",
122+
global_best_difficulty,
123+
min_difficulty,
124+
));
125+
}
119126
if global_best_difficulty.ge(&min_difficulty) {
120127
// Mine until min difficulty has been met
121128
break;
122129
}
123130
} else if i == 0 {
124131
progress_bar.set_message(format!(
125-
"Mining... ({} sec remaining)",
132+
"Mining... ({} / {} difficulty, {} sec remaining)",
133+
global_best_difficulty,
134+
min_difficulty,
126135
cutoff_time.saturating_sub(timer.elapsed().as_secs()),
127136
));
128137
}

0 commit comments

Comments
 (0)