Skip to content

Commit

Permalink
fix(network): never reconnect bootstrap again after failure (nervosne…
Browse files Browse the repository at this point in the history
…twork#22)

* fix(network): never re-connect to bootstrap after connection failure

Should not remove bootstrap peers

* fix(network): warning on empty no peers array

When no peers array is empty, it means we have connection to requested
peers.
  • Loading branch information
zeroqn authored and yejiayu committed Oct 18, 2019
1 parent 5652693 commit 79d66bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/network/src/peer_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,9 @@ impl PeerManager {
}
}

warn!("network: no peers {:?}", no_peers);
if !no_peers.is_empty() {
warn!("network: no peers {:?}", no_peers);
}

// Send message to connected users
let tar = TargetSession::Multi(connected);
Expand Down Expand Up @@ -921,6 +923,7 @@ impl PeerManager {

if self.bootstraps.contains(&addr) {
error!("network: unconnectable bootstrap address {}", addr);
return;
}

self.inner.try_remove_addr(&addr);
Expand Down

0 comments on commit 79d66bd

Please sign in to comment.