Show more information when too many addresses are reported (#2473)

* Show more information when too many addresses are reported

* Update core/network-libp2p/src/behaviour.rs

Co-Authored-By: tomaka <pierre.krieger1708@gmail.com>
This commit is contained in:
Pierre Krieger
2019-05-06 09:32:35 +02:00
committed by Bastian Köcher
parent b0c21da94f
commit 82cb52a400
@@ -261,8 +261,10 @@ impl<TMessage, TSubstream> NetworkBehaviourEventProcess<IdentifyEvent> for Behav
warn!(target: "sub-libp2p", "Connected to a non-Substrate node: {:?}", info);
}
if info.listen_addrs.len() > 30 {
warn!(target: "sub-libp2p", "Node {:?} id reported more than 30 addresses",
peer_id);
warn!(target: "sub-libp2p", "Node {:?} has reported more than 30 addresses; \
it is identified by {:?} and {:?}", peer_id, info.protocol_version,
info.agent_version
);
info.listen_addrs.truncate(30);
}
for addr in &info.listen_addrs {