Browse Source

Merge pull request #583 from libp2p/fix/faster-observer

identify: avoid parsing/printing multiaddrs
pull/586/head
vyzo 6 years ago
committed by GitHub
parent
commit
9051b3c26e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      p2p/protocol/identify/obsaddr.go

3
p2p/protocol/identify/obsaddr.go

@ -167,7 +167,8 @@ func (oas *ObservedAddrSet) Add(observed, local, observer ma.Multiaddr,
// IP addresses. In practice, this is what we want.
func observerGroup(m ma.Multiaddr) string {
//TODO: If IPv6 rolls out we should mark /64 routing zones as one group
return ma.Split(m)[0].String()
first, _ := ma.SplitFirst(m)
return string(first.Bytes())
}
func (oas *ObservedAddrSet) SetTTL(ttl time.Duration) {

Loading…
Cancel
Save