Merge pull request #135 from libp2p/feat/remove-non-gc-removal

Only remove records during GC
This commit is contained in:
Steven Allen 2021-07-16 20:43:52 -07:00 committed by GitHub
commit eef7cecd29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,11 +295,6 @@ func (mab *memoryAddrBook) SetAddrs(p peer.ID, addrs []ma.Multiaddr, ttl time.Du
delete(amap, key)
}
}
// if we've expired all the signed addresses for a peer, remove their signed routing state record
if len(amap) == 0 {
delete(s.signedPeerRecords, p)
}
}
// UpdateAddrs updates the addresses associated with the given peer that have
@ -330,11 +325,6 @@ func (mab *memoryAddrBook) UpdateAddrs(p peer.ID, oldTTL time.Duration, newTTL t
}
}
}
// if we've expired all the signed addresses for a peer, remove their signed routing state record
if len(amap) == 0 {
delete(s.signedPeerRecords, p)
}
}
// Addrs returns all known (and valid) addresses for a given peer