code: func (net *Network) Close() {
  	net.conn.Close()
  	select {
  	case <-net.closed:
  	case net.closeReq <- struct{}{}:
  		<-net.closed
  	}
  }
docs: // Close terminates the network listener and flushes the node database.