code: func (ps *peerSet) Register(p *peer) error {
  	ps.lock.Lock()
  	if ps.closed {
  		ps.lock.Unlock()
  		return errClosed
  	}
  	if _, ok := ps.peers[p.id]; ok {
  		ps.lock.Unlock()
  		return errAlreadyRegistered
  	}
  	ps.peers[p.id] = p
  	p.sendQueue = newExecQueue(100)
  	peers := make([]peerSetNotify, len(ps.notifyList))
  	copy(peers, ps.notifyList)
  	ps.lock.Unlock()
  
  	for _, n := range peers {
  		n.registerPeer(p)
  	}
  	return nil
  }
docs: // Register injects a new peer into the working set, or returns an error if the
  // peer is already known.