MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / Has

Method Has

p2p/peer_set.go:64–69  ·  view source on GitHub ↗

Has returns true if the set contains the peer referred to by this peerKey, otherwise false.

(peerKey ID)

Source from the content-addressed store, hash-verified

62// Has returns true if the set contains the peer referred to by this
63// peerKey, otherwise false.
64func (ps *PeerSet) Has(peerKey ID) bool {
65 ps.mtx.Lock()
66 _, ok := ps.lookup[peerKey]
67 ps.mtx.Unlock()
68 return ok
69}
70
71// HasIP returns true if the set contains the peer referred to by this IP
72// address, otherwise false.

Callers 2

TestPeerSetAddRemoveOneFunction · 0.95
TestPeerSetAddRemoveManyFunction · 0.95

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by 2

TestPeerSetAddRemoveOneFunction · 0.76
TestPeerSetAddRemoveManyFunction · 0.76