Skip to content

Commit

Permalink
Restore simple approach.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheatfate committed Nov 25, 2024
1 parent 4248228 commit a70d65d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions libp2p/peerstore.nim
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,7 @@ proc updatePeerInfo*(
if observedAddr.isNone():
default(seq[MultiAddress])
else:
let res = observedAddr.get()
if TCP.match(res):
# We should form full P2P address in case of simple TCP address.
let
p2p = MultiAddress.init(multiCodec("p2p"), info.peerId).valueOr:
raiseAssert "Initialization should not fail"
ma = concat(res, p2p).valueOr:
raiseAssert "Concatenation should not fail"
@[ma]
else:
@[res]
@[observedAddr.get()]
addresses = info.addrs & observed

if len(addresses) > 0:
Expand Down

0 comments on commit a70d65d

Please sign in to comment.