Implemented status bar with some status information: sync process, connected nodes and blockchain height.

This commit is contained in:
Revertron
2021-02-27 18:57:15 +01:00
parent 0d3b8c3db0
commit e53245315f
12 changed files with 192 additions and 95 deletions
+7 -2
View File
@@ -10,11 +10,12 @@ pub struct Peer {
height: u64,
inbound: bool,
public: bool,
active: bool,
}
impl Peer {
pub fn new(addr: SocketAddr, stream: TcpStream, state: State, inbound: bool) -> Self {
Peer { addr, stream, state, height: 0, inbound, public: false }
Peer { addr, stream, state, height: 0, inbound, public: false, active: false }
}
pub fn get_addr(&self) -> SocketAddr {
@@ -53,8 +54,12 @@ impl Peer {
self.public = public;
}
pub fn set_active(&mut self, active: bool) {
self.active = active;
}
pub fn active(&self) -> bool {
self.state.active()
self.active
}
pub fn disabled(&self) -> bool {