Implement Goodbye and BeaconState msg handlers

This commit is contained in:
Paul Hauner
2019-03-24 17:51:32 +11:00
parent f918f42b28
commit 796b68dc04
4 changed files with 79 additions and 9 deletions

View File

@@ -119,6 +119,16 @@ impl SimpleSync {
}
}
pub fn on_goodbye(&mut self, peer_id: PeerId, reason: GoodbyeReason) {
info!(
self.log, "PeerGoodbye";
"peer" => format!("{:?}", peer_id),
"reason" => format!("{:?}", reason),
);
self.known_peers.remove(&peer_id);
}
pub fn on_connect(&self, peer_id: PeerId, network: &mut NetworkContext) {
info!(self.log, "PeerConnect"; "peer" => format!("{:?}", peer_id));