@@ -43,7 +43,7 @@ impl Miner {
43
43
get_updated_proof_with_authority ( & self . rpc_client , signer. pubkey ( ) , last_hash_at)
44
44
. await ;
45
45
println ! (
46
- "\n Stake: {} ORE\n {} Multiplier: {:12}x" ,
46
+ "\n \ n Stake: {} ORE\n {} Multiplier: {:12}x" ,
47
47
amount_u64_to_string( proof. balance) ,
48
48
if last_hash_at. gt( & 0 ) {
49
49
format!(
@@ -151,7 +151,7 @@ impl Miner {
151
151
if timer. elapsed ( ) . as_secs ( ) . ge ( & cutoff_time) {
152
152
if i. id == 0 {
153
153
progress_bar. set_message ( format ! (
154
- "Mining... ({} difficulty )" ,
154
+ "Mining... (difficulty {} )" ,
155
155
global_best_difficulty,
156
156
) ) ;
157
157
}
@@ -161,9 +161,12 @@ impl Miner {
161
161
}
162
162
} else if i. id == 0 {
163
163
progress_bar. set_message ( format ! (
164
- "Mining... ({} difficulty, {} sec remaining )" ,
164
+ "Mining... (difficulty {}, time {} )" ,
165
165
global_best_difficulty,
166
- cutoff_time. saturating_sub( timer. elapsed( ) . as_secs( ) ) ,
166
+ format_duration(
167
+ cutoff_time. saturating_sub( timer. elapsed( ) . as_secs( ) )
168
+ as u32
169
+ ) ,
167
170
) ) ;
168
171
}
169
172
}
@@ -195,7 +198,7 @@ impl Miner {
195
198
196
199
// Update log
197
200
progress_bar. finish_with_message ( format ! (
198
- "Best hash: {} (difficulty: {})" ,
201
+ "Best hash: {} (difficulty {})" ,
199
202
bs58:: encode( best_hash. h) . into_string( ) ,
200
203
best_difficulty
201
204
) ) ;
@@ -260,3 +263,9 @@ impl Miner {
260
263
fn calculate_multiplier ( balance : u64 , top_balance : u64 ) -> f64 {
261
264
1.0 + ( balance as f64 / top_balance as f64 ) . min ( 1.0f64 )
262
265
}
266
+
267
+ fn format_duration ( seconds : u32 ) -> String {
268
+ let minutes = seconds / 60 ;
269
+ let remaining_seconds = seconds % 60 ;
270
+ format ! ( "{:02}:{:02}" , minutes, remaining_seconds)
271
+ }
0 commit comments