private void OnConnected(RemoteNode remoteNode) { lock (connectedPeers) { connectedPeers.Add(remoteNode); } remoteNode.Disconnected += RemoteNode_Disconnected; remoteNode.InventoryReceived += RemoteNode_InventoryReceived; remoteNode.PeersReceived += RemoteNode_PeersReceived; remoteNode.StartProtocol(); }
private void OnConnected(RemoteNode remoteNode) { lock (connectedPeers) { connectedPeers.Add(remoteNode); } remoteNode.Disconnected += RemoteNode_Disconnected; // 断开连接通知 remoteNode.InventoryReceived += RemoteNode_InventoryReceived; // 账单消息通知 remoteNode.PeersReceived += RemoteNode_PeersReceived; // 节点列表信息通知 remoteNode.StartProtocol(); // 开启通信协议 }