Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Aug 28, 2024
1 parent c856e48 commit 5a0c8fa
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src-tauri/src/node_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,25 @@ impl MinotariNodeStatusMonitor {
let mut res = res.into_inner();
// Get the last one.
let mut result = Err(anyhow::anyhow!("No difficulty found"));
// base node returns 0 for hashrate when the algo doesn't match, so we need to keep track of last one.
let mut last_sha3_estimated_hashrate = 0;
let mut last_randomx_estimated_hashrate = 0;
if let Some(difficulty) = res.message().await? {
result = Ok((
if difficulty.sha3x_estimated_hash_rate != 0 {
last_sha3_estimated_hashrate = difficulty.sha3x_estimated_hash_rate;
}
if difficulty.randomx_estimated_hash_rate != 0 {
last_randomx_estimated_hashrate = difficulty.randomx_estimated_hash_rate;
}
dbg!(
last_sha3_estimated_hashrate,
last_randomx_estimated_hashrate,
difficulty.sha3x_estimated_hash_rate,
difficulty.randomx_estimated_hash_rate,
difficulty.randomx_estimated_hash_rate
);
result = Ok((
last_sha3_estimated_hashrate,
last_randomx_estimated_hashrate,
MicroMinotari(reward),
block_height,
block_time,
Expand Down

0 comments on commit 5a0c8fa

Please sign in to comment.