Skip to content

Commit 818e4b5

Browse files
committed
feat: log difficulty
1 parent ea4cfa7 commit 818e4b5

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/mine.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
use std::{sync::Arc, sync::RwLock, time::Instant};
22

33
use colored::*;
4-
use drillx::{
5-
equix::{self},
6-
Hash, Solution,
7-
};
4+
use drillx::{difficulty, equix::{self}, Hash, Solution};
85
use ore_api::{
96
consts::{BUS_ADDRESSES, BUS_COUNT, EPOCH_DURATION},
107
state::{Config, Proof},
@@ -116,13 +113,22 @@ impl Miner {
116113
if nonce % 100 == 0 {
117114
let global_best_difficulty = *global_best_difficulty.read().unwrap();
118115
if timer.elapsed().as_secs().ge(&cutoff_time) {
116+
if i == 0 {
117+
progress_bar.set_message(format!(
118+
"Mining... ({} / {} difficulty)",
119+
global_best_difficulty,
120+
min_difficulty,
121+
));
122+
}
119123
if global_best_difficulty.ge(&min_difficulty) {
120124
// Mine until min difficulty has been met
121125
break;
122126
}
123127
} else if i == 0 {
124128
progress_bar.set_message(format!(
125-
"Mining... ({} sec remaining)",
129+
"Mining... ({} / {} difficulty, {} sec remaining)",
130+
global_best_difficulty,
131+
min_difficulty,
126132
cutoff_time.saturating_sub(timer.elapsed().as_secs()),
127133
));
128134
}

0 commit comments

Comments
 (0)