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:
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user