func (p *ProtocolHandler) Disconnected(net network.Network, conn network.Conn) {
	peerID := conn.RemotePeer()

	if net.Connectedness(peerID) == network.NotConnected {
		p.outgoingMessagesLock.Lock()
		defer p.outgoingMessagesLock.Unlock()
		if handler, found := p.outgoingMessages[peerID]; found {
			close(handler)
			delete(p.outgoingMessages, peerID)
		}
	}
}
// Disconnected is called when we disconnect to a peer.
Disconnected is called when we disconnect to a peer.
// Disconnected is called when we disconnect to a peer .
func (p *ProtocolHandler) Disconnected(net network.Network, conn network.Conn) {
	peerID := conn.RemotePeer()
	if net.Connectedness(peerID) == network.NotConnected {
		p.outgoingMessagesLock.Lock()
		defer p.outgoingMessagesLock.Unlock()
		if handler, found := p.outgoingMessages[peerID]; found {
			close(handler)
			delete(p.outgoingMessages, peerID)
		}
	}
}
func ( p * ProtocolHandler ) Disconnected ( net network . Network , conn network . Conn ) { peerID := conn . RemotePeer ( ) if net . Connectedness ( peerID ) == network . NotConnected { p . outgoingMessagesLock . Lock ( ) defer p . outgoingMessagesLock . Unlock ( ) if handler , found := p . outgoingMessages [ peerID ] ; found { close ( handler ) delete ( p . outgoingMessages , peerID ) } } }
Disconnected is called when we disconnect to a peer.
Disconnected is called when we disconnect to a peer .