Has() returns if the set has a peer with a specific public key
(publicKey []byte)
| 272 | |
| 273 | // Has() returns if the set has a peer with a specific public key |
| 274 | func (ps *PeerSet) Has(publicKey []byte) bool { |
| 275 | defer lib.TimeTrack(ps.logger, time.Now(), time.Second) |
| 276 | unlock := rlockWithTrace("peerset", &ps.mux, ps.logger) |
| 277 | defer unlock() |
| 278 | pubKey := lib.BytesToString(publicKey) |
| 279 | _, found := ps.m[pubKey] |
| 280 | return found |
| 281 | } |
| 282 | |
| 283 | // Stop() stops the entire peer set |
| 284 | func (ps *PeerSet) Stop() { |