Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Print an error if listener is closed #4830

Merged
merged 2 commits into from
Feb 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion client/network/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ use libp2p::core::{nodes::Substream, muxing::StreamMuxerBox};
#[cfg(not(target_os = "unknown"))]
use libp2p::mdns::{Mdns, MdnsEvent};
use libp2p::multiaddr::Protocol;
use log::{debug, info, trace, warn};
use log::{debug, info, trace, warn, error};
use std::{cmp, collections::VecDeque, time::Duration};
use std::task::{Context, Poll};
use sp_core::hexdisplay::HexDisplay;
Expand Down Expand Up @@ -304,10 +304,12 @@ where
}

fn inject_listener_error(&mut self, id: ListenerId, err: &(dyn std::error::Error + 'static)) {
error!(target: "sub-libp2p", "Error on libp2p listener {:?}: {}", id, err);
NetworkBehaviour::inject_listener_error(&mut self.kademlia, id, err);
}

fn inject_listener_closed(&mut self, id: ListenerId) {
error!(target: "sub-libp2p", "Libp2p listener {:?} closed", id);
NetworkBehaviour::inject_listener_closed(&mut self.kademlia, id);
}

Expand Down