AddPeer add the peer to the pool
(p SyncPeer)
| 266 | |
| 267 | // AddPeer add the peer to the pool |
| 268 | func (s *Synchronizer) AddPeer(p SyncPeer) error { |
| 269 | s.peerMutex.Lock() |
| 270 | defer s.peerMutex.Unlock() |
| 271 | if len(s.peers) <= 25 { |
| 272 | s.peers[p.IDString()] = p |
| 273 | } |
| 274 | return nil |
| 275 | } |
| 276 | |
| 277 | // RemovePeer remove the peer |
| 278 | func (s *Synchronizer) RemovePeer(peer string) error { |