From 6ba093d14fd263073902e70b6ced458d45256e6b Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Fri, 30 Aug 2019 17:06:59 +1000 Subject: [PATCH] Add warning when disconnecting peer --- beacon_node/network/src/sync/simple_sync.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/beacon_node/network/src/sync/simple_sync.rs b/beacon_node/network/src/sync/simple_sync.rs index d3ed2f3e4..222b4c7fc 100644 --- a/beacon_node/network/src/sync/simple_sync.rs +++ b/beacon_node/network/src/sync/simple_sync.rs @@ -525,6 +525,13 @@ impl NetworkContext { } pub fn disconnect(&mut self, peer_id: PeerId, reason: GoodbyeReason) { + warn!( + &self.log, + "Disconnecting peer"; + "reason" => format!("{:?}", reason), + "peer_id" => format!("{:?}", peer_id), + ); + self.send_rpc_request(None, peer_id, RPCRequest::Goodbye(reason)) // TODO: disconnect peers. }