Commit 77a9168a authored by Juan Batiz-Benet's avatar Juan Batiz-Benet
Browse files

p2p/id: SET listen addrs, clearing old ones.

parent c7c0445b
......@@ -176,8 +176,9 @@ func (ids *IDService) consumeMessage(mes *pb.Identify, c inet.Conn) {
lmaddrs = append(lmaddrs, maddr)
}
// update our peerstore with the addresses.
ids.Host.Peerstore().AddAddresses(p, lmaddrs)
// update our peerstore with the addresses. here, we SET the addresses, clearing old ones.
// We are receiving from the peer itself. this is current address ground truth.
ids.Host.Peerstore().SetAddresses(p, lmaddrs)
log.Debugf("%s received listen addrs for %s: %s", c.LocalPeer(), c.RemotePeer(), lmaddrs)
// get protocol versions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment