From 846dd8c89ef7e899ae7a6bba341276090b79710f Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 6 Sep 2021 15:19:43 +0300 Subject: [PATCH] [#645] network: Remove no longer used `IsLocalAddress` function In recent changes, the locality criterion for a node has been changed to compare public keys. Remove no longer used `IsLocalAddress` function and `LocalAddressSource` interface. Signed-off-by: Leonard Lyubich --- pkg/network/address.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pkg/network/address.go b/pkg/network/address.go index a1758a497..784e8058e 100644 --- a/pkg/network/address.go +++ b/pkg/network/address.go @@ -23,12 +23,6 @@ type Address struct { ma multiaddr.Multiaddr } -// LocalAddressSource is an interface of local -// network address container with read access. -type LocalAddressSource interface { - LocalAddress() AddressGroup -} - // String returns multiaddr string. func (a Address) String() string { return a.ma.String() @@ -135,9 +129,3 @@ func multiaddrStringFromHostAddr(host string) (string, error) { return strings.Join([]string{prefix, addr, l4Protocol, port}, "/"), nil } - -// IsLocalAddress returns true if network endpoints from local address group -// source intersects with network endpoints of passed address group. -func IsLocalAddress(src LocalAddressSource, addr AddressGroup) bool { - return src.LocalAddress().Intersects(addr) -}