Skip to content

Commit

Permalink
replace peer addresses in identify
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Apr 16, 2019
1 parent 4722f1a commit 06391d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions p2p/protocol/identify/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,10 @@ func (ids *IDService) consumeMessage(mes *pb.Identify, c inet.Conn) {
ids.addrMu.Lock()
switch ids.Host.Network().Connectedness(p) {
case inet.Connected:
ids.Host.Peerstore().UpdateAddrs(p, pstore.ConnectedAddrTTL, 0)
ids.Host.Peerstore().AddAddrs(p, lmaddrs, pstore.ConnectedAddrTTL)
default:
ids.Host.Peerstore().UpdateAddrs(p, pstore.ConnectedAddrTTL, 0)
ids.Host.Peerstore().AddAddrs(p, lmaddrs, pstore.RecentlyConnectedAddrTTL)
}
ids.addrMu.Unlock()
Expand Down

0 comments on commit 06391d4

Please sign in to comment.