Add `Hydrabadger::is_validator`.

This commit is contained in:
c0gent 2018-10-19 14:39:31 -07:00
parent 1898bea18c
commit 5e4eabf787
No known key found for this signature in database
GPG Key ID: 9CC25E71A743E892
1 changed files with 4 additions and 0 deletions

View File

@ -207,6 +207,10 @@ impl<T: Contribution> Hydrabadger<T> {
sd
}
pub fn is_validator(&self) -> bool {
StateDsct::from(self.inner.state_dsct.load(Ordering::Relaxed)) == StateDsct::Validator
}
/// Returns a reference to the peers list.
pub fn peers(&self) -> RwLockReadGuard<Peers<T>> {
self.inner.peers.read()