Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
77a9168a
Commit
77a9168a
authored
Jan 26, 2015
by
Juan Batiz-Benet
Browse files
p2p/id: SET listen addrs, clearing old ones.
parent
c7c0445b
Changes
1
Hide whitespace changes
Inline
Side-by-side
protocol/identify/id.go
View file @
77a9168a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment