code: func (s *ChainService) peerDoneHandler(sp *ServerPeer) {
  	sp.WaitForDisconnect()
  
  	select {
  	case s.donePeers <- sp:
  	case <-s.quit:
  		return
  	}
  
  	// Only tell block manager we are gone if we ever told it we existed.
  	if sp.VersionKnown() {
  		s.blockManager.DonePeer(sp)
  	}
  	close(sp.quit)
  }
docs: // peerDoneHandler handles peer disconnects by notifiying the server that it's
  // done along with other performing other desirable cleanup.