struct Peer {
channel_encryptor: PeerChannelEncryptor,
- outbound: bool,
their_node_id: Option<PublicKey>,
their_features: Option<InitFeatures>,
let mut peers = self.peers.lock().unwrap();
if peers.peers.insert(descriptor, Peer {
channel_encryptor: peer_encryptor,
- outbound: true,
their_node_id: None,
their_features: None,
let mut peers = self.peers.lock().unwrap();
if peers.peers.insert(descriptor, Peer {
channel_encryptor: peer_encryptor,
- outbound: false,
their_node_id: None,
their_features: None,
peer.pending_read_is_header = true;
peer.their_node_id = Some(their_node_id);
insert_node_id!();
+ let features = InitFeatures::known();
+ let resp = msgs::Init { features };
+ self.enqueue_message(&mut peers.peers_needing_send, peer, peer_descriptor.clone(), &resp);
},
NextNoiseStep::NoiseComplete => {
if peer.pending_read_is_header {
return Err(PeerHandleError{ no_connection_possible: true }.into());
}
- if !peer.outbound {
- let features = InitFeatures::known();
- let resp = msgs::Init { features };
- self.enqueue_message(peers_needing_send, peer, peer_descriptor.clone(), &resp);
- }
-
self.message_handler.route_handler.sync_routing_table(&peer.their_node_id.unwrap(), &msg);
self.message_handler.chan_handler.peer_connected(&peer.their_node_id.unwrap(), &msg);