From 316f0867f68564ed7128bb740fdcbb42b0f46988 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 8 Apr 2019 18:41:22 -0700 Subject: [PATCH] identify: avoid parsing/printing multiaddrs --- p2p/protocol/identify/obsaddr.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/p2p/protocol/identify/obsaddr.go b/p2p/protocol/identify/obsaddr.go index 793105bd..af153edc 100644 --- a/p2p/protocol/identify/obsaddr.go +++ b/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) {