Skip to content

Commit 2eb7aa8

Browse files
authored
Update mine.rs
1 parent 87e7b6e commit 2eb7aa8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/mine.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,17 @@ impl Miner {
4242
let proof =
4343
get_updated_proof_with_authority(&self.rpc_client, signer.pubkey(), last_hash_at)
4444
.await;
45-
last_hash_at = proof.last_hash_at;
4645
println!(
47-
"\nStake: {} ORE\n Change: {} ORE\n Multiplier: {:12}x",
46+
"\nStake: {} ORE\n{} Multiplier: {:12}x",
4847
amount_u64_to_string(proof.balance),
49-
amount_u64_to_string(proof.balance.saturating_sub(last_balance)),
48+
if last_hash_at.gt(&0) {
49+
format!(" Change: {} ORE\n", amount_u64_to_string(proof.balance.saturating_sub(last_balance)))
50+
} else {
51+
""
52+
},
5053
calculate_multiplier(proof.balance, config.top_balance)
5154
);
55+
last_hash_at = proof.last_hash_at;
5256
last_balance = proof.balance;
5357

5458
// Calculate cutoff time

0 commit comments

Comments
 (0)