diff --git a/p2p/protocol/identify/obsaddr.go b/p2p/protocol/identify/obsaddr.go index 53a5f9c5b..b0c8b19c7 100644 --- a/p2p/protocol/identify/obsaddr.go +++ b/p2p/protocol/identify/obsaddr.go @@ -160,7 +160,11 @@ func (oas *ObservedAddrSet) gc() { filteredAddrs = append(filteredAddrs, a) } } - oas.addrs[local] = filteredAddrs + if len(filteredAddrs) > 0 { + oas.addrs[local] = filteredAddrs + } else { + delete(oas.addrs, local) + } } }