Skip to content

Commit 96ab7e8

Browse files
committed
Checking if ENR information is present when adding peers
1 parent 7772e87 commit 96ab7e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

waku/node/peer_manager/peer_manager.nim

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ proc addPeer*(pm: PeerManager, remotePeerInfo: RemotePeerInfo, origin = UnknownO
121121
discard remotePeerInfo.peerId.extractPublicKey(publicKey)
122122

123123
if pm.peerStore[AddressBook][remotePeerInfo.peerId] == remotePeerInfo.addrs and
124-
not ($remotePeerInfo.addrs).contains("127.0.0.1") and
125-
pm.peerStore[KeyBook][remotePeerInfo.peerId] == publicKey:
126-
# Peer already managed
124+
pm.peerStore[KeyBook][remotePeerInfo.peerId] == publicKey and
125+
pm.peerStore[ENRBook][remotePeerInfo.peerId].raw.len > 0:
126+
# Peer already managed and ENR info is already saved
127127
return
128128

129129
trace "Adding peer to manager", peerId = remotePeerInfo.peerId, addresses = remotePeerInfo.addrs

0 commit comments

Comments
 (0)