Skip to content

Commit

Permalink
Merge pull request #7 from spectrum-finance/dev-418-handle-dial-failu…
Browse files Browse the repository at this point in the history
…re-in-networkcontroller

Handle dial failure in `NetworkController`
  • Loading branch information
oskin1 authored Nov 11, 2022
2 parents e37a9e9 + 8cf31e8 commit 48f5d0b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions spectrum-network/src/network_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,7 @@ where
match enabled_protocols.entry(protocol_id) {
Entry::Occupied(mut entry) => {
if let (EnabledProtocol::PendingEnable, handler) = entry.get() {
handler.protocol_enabled(
peer_id,
protocol_ver,
out_channel.clone(),
);
handler.protocol_enabled(peer_id, protocol_ver, out_channel.clone());
let enabled_protocol = EnabledProtocol::Enabled {
ver: protocol_ver,
sink: out_channel,
Expand Down Expand Up @@ -388,7 +384,9 @@ where
}

fn inject_dial_failure(&mut self, peer_id: Option<PeerId>, _: Self::ConnectionHandler, _: &DialError) {
// todo: DEV-418: notify PM
if let Some(peer_id) = peer_id {
self.peers.dial_failure(peer_id);
}
}

fn poll(
Expand Down

0 comments on commit 48f5d0b

Please sign in to comment.