From fe7ba05e38c294f2163d0a2c1ea226712e20201b Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 9 Apr 2019 14:00:03 +0300 Subject: [PATCH] delete empty address sets on observed address set gc --- p2p/protocol/identify/obsaddr.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) + } } }