node: fix stats getting to avoid deadlock
This commit is contained in:
parent
f083546c7c
commit
36720bc6e2
1 changed files with 4 additions and 4 deletions
|
@ -134,8 +134,8 @@ impl Node {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get [`StratumServer`] statistics.
|
/// Get [`StratumServer`] statistics.
|
||||||
pub fn get_stratum_stats() -> grin_util::RwLockReadGuard<'static, StratumStats> {
|
pub fn get_stratum_stats() -> StratumStats {
|
||||||
NODE_STATE.stratum_stats.read()
|
NODE_STATE.stratum_stats.read().clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Stop [`StratumServer`].
|
/// Stop [`StratumServer`].
|
||||||
|
@ -169,8 +169,8 @@ impl Node {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get node [`Server`] statistics.
|
/// Get node [`Server`] statistics.
|
||||||
pub fn get_stats() -> RwLockReadGuard<'static, Option<ServerStats>> {
|
pub fn get_stats() -> Option<ServerStats> {
|
||||||
NODE_STATE.stats.read().unwrap()
|
NODE_STATE.stats.read().unwrap().clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check if [`Server`] is not syncing (disabled or just running after synchronization).
|
/// Check if [`Server`] is not syncing (disabled or just running after synchronization).
|
||||||
|
|
Loading…
Reference in a new issue