TUI mining server status: add blocks found statistics (#2151)

* TUI mining server status: add solutions found statistics

* rustfmt

* modify 'solutions found' as 'blocks found'
This commit is contained in:
Gary Yu
2018-12-15 10:10:33 +08:00
committed by GitHub
parent 8e678058f1
commit 197d4f9575
3 changed files with 27 additions and 13 deletions
+3
View File
@@ -80,6 +80,8 @@ pub struct WorkerStats {
pub num_rejected: u64,
/// number of shares submitted too late
pub num_stale: u64,
/// number of valid blocks found
pub num_blocks_found: u64,
}
/// Struct to return relevant information about the stratum server
@@ -209,6 +211,7 @@ impl Default for WorkerStats {
num_accepted: 0,
num_rejected: 0,
num_stale: 0,
num_blocks_found: 0,
}
}
}
+6 -2
View File
@@ -512,10 +512,14 @@ impl StratumServer {
return Err(serde_json::to_value(e).unwrap());
}
share_is_block = true;
worker_stats.num_blocks_found += 1;
// Log message to make it obvious we found a block
warn!(
"(Server ID: {}) Solution Found for block {} - Yay!!!",
self.id, params.height
"(Server ID: {}) Solution Found for block {} - Yay!!! Worker ID: {}, blocks found: {}, shares: {}",
self.id, params.height,
worker_stats.id,
worker_stats.num_blocks_found,
worker_stats.num_accepted,
);
} else {
// Do some validation but dont submit