p2p: document that RemovePeer blocks

This commit is contained in:
Felix Lange 2020-02-09 17:45:11 +01:00
parent df6ae09307
commit a132830195

View file

@ -326,6 +326,9 @@ func (srv *Server) AddPeer(node *enode.Node) {
// RemovePeer removes a node from the static node set. It also disconnects from the given // RemovePeer removes a node from the static node set. It also disconnects from the given
// node if it is currently connected as a peer. // node if it is currently connected as a peer.
//
// This method blocks until all protocols have exited and the peer is removed. Do not use
// RemovePeer in protocol implementations, call Disconnect on the Peer instead.
func (srv *Server) RemovePeer(node *enode.Node) { func (srv *Server) RemovePeer(node *enode.Node) {
var ( var (
ch chan *PeerEvent ch chan *PeerEvent