Correct issue with dialing peers (#2375)

The ordering of adding new peers to the peerdb and deciding when to dial them was not considered in a previous update.

This adds the condition that if a peer is not in the peer-db then it is an acceptable peer to dial.

This makes #2374 obsolete.
This commit is contained in:
Age Manning
2021-05-29 07:25:06 +00:00
parent d12e746b50
commit ec5cceba50
2 changed files with 47 additions and 46 deletions

View File

@@ -160,6 +160,7 @@ impl<TSpec: EthSpec> PeerDB<TSpec> {
self.connection_status(peer_id),
Some(PeerConnectionStatus::Disconnected { .. })
| Some(PeerConnectionStatus::Unknown { .. })
| None
) && !self.is_banned_or_disconnected(peer_id)
}