Has returns true if the set contains the peer referred to by this peerKey, otherwise false.
(peerKey ID)
| 62 | // Has returns true if the set contains the peer referred to by this |
| 63 | // peerKey, otherwise false. |
| 64 | func (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. |