mirror of
https://github.com/libp2p/go-libp2p-peerstore.git
synced 2025-03-22 12:50:07 +08:00
memoryAddrBook: document gc precondition
This commit is contained in:
parent
e3a2970d93
commit
6daee68364
@ -45,6 +45,7 @@ func NewAddrBook() pstore.AddrBook {
|
||||
}
|
||||
}
|
||||
|
||||
// gc garbage collects the in-memory address book. The caller *must* hold the addrmu lock.
|
||||
func (mab *memoryAddrBook) gc() {
|
||||
now := time.Now()
|
||||
if !now.After(mab.nextGC) {
|
||||
|
Loading…
Reference in New Issue
Block a user