fix: nodes in AddressBook are not necessarily connected (#1161)

This commit is contained in:
Hanno Cornelius 2022-09-20 10:00:40 +01:00 committed by GitHub
parent f73477be6e
commit 9be3d296be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -707,7 +707,7 @@ proc runDiscv5Loop(node: WakuNode) {.async.} =
trace "Discovered peers", count=discoveredPeers.get().len()
let newPeers = discoveredPeers.get().filterIt(
not node.switch.peerStore[AddressBook].contains(it.peerId))
not node.switch.isConnected(it.peerId))
if newPeers.len > 0:
debug "Connecting to newly discovered peers", count=newPeers.len()