|
@ -131,12 +131,12 @@ func (sw *Switch) AddPeerWithConnection(conn net.Conn, outbound bool) (*Peer, er |
|
|
return nil, ErrSwitchDuplicatePeer |
|
|
return nil, ErrSwitchDuplicatePeer |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Notify listeners.
|
|
|
|
|
|
sw.doAddPeer(peer) |
|
|
|
|
|
|
|
|
|
|
|
// Start the peer
|
|
|
// Start the peer
|
|
|
go peer.start() |
|
|
go peer.start() |
|
|
|
|
|
|
|
|
|
|
|
// Notify listeners.
|
|
|
|
|
|
sw.doAddPeer(peer) |
|
|
|
|
|
|
|
|
// Send handshake
|
|
|
// Send handshake
|
|
|
msg := &pexHandshakeMessage{Network: sw.network} |
|
|
msg := &pexHandshakeMessage{Network: sw.network} |
|
|
peer.Send(PexChannel, msg) |
|
|
peer.Send(PexChannel, msg) |
|
|