From 44e2b64c3429687c2809135e9ff3920c6a85d8f1 Mon Sep 17 00:00:00 2001 From: gammazero Date: Thu, 13 Jul 2023 03:02:27 -0700 Subject: [PATCH] remove unused code --- pkg/dtrack/distance_tracker.go | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/pkg/dtrack/distance_tracker.go b/pkg/dtrack/distance_tracker.go index 89b5c93..1c2c29d 100644 --- a/pkg/dtrack/distance_tracker.go +++ b/pkg/dtrack/distance_tracker.go @@ -10,7 +10,6 @@ import ( "github.com/ipni/go-libipni/pcache" "github.com/ipni/ipni-cli/pkg/adpub" "github.com/libp2p/go-libp2p/core/peer" - "github.com/multiformats/go-multiaddr" ) type DistanceUpdate struct { @@ -28,13 +27,11 @@ const ( ) type distTrack struct { - dist int - head cid.Cid - ad cid.Cid - client adpub.Client - publisher peer.AddrInfo - err error - errType int + dist int + head cid.Cid + ad cid.Cid + err error + errType int } func RunDistanceTracker(ctx context.Context, include, exclude map[peer.ID]struct{}, provCache *pcache.ProviderCache, updateIn time.Duration) <-chan DistanceUpdate { @@ -223,15 +220,3 @@ func updateTrack(ctx context.Context, pid peer.ID, track *distTrack, provCache * Distance: track.dist, } } - -func maddrsEqual(a, b []multiaddr.Multiaddr) bool { - if len(a) != len(b) { - return false - } - for i := range a { - if !a[i].Equal(b[i]) { - return false - } - } - return true -}