From: Matt Corallo Date: Sat, 8 Sep 2018 17:57:20 +0000 (-0400) Subject: Fix PeerManager::get_peer_node_ids to filter according to docs X-Git-Tag: v0.0.12~319^2~1 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=bf46a5f721ec7ab4c4b7a466bd8f25951f6af9a4;p=rust-lightning Fix PeerManager::get_peer_node_ids to filter according to docs --- diff --git a/src/ln/peer_handler.rs b/src/ln/peer_handler.rs index d7a7553ed..3d3588a4d 100644 --- a/src/ln/peer_handler.rs +++ b/src/ln/peer_handler.rs @@ -147,7 +147,12 @@ impl PeerManager { /// completed and we are sure the remote peer has the private key for the given node_id. pub fn get_peer_node_ids(&self) -> Vec { let peers = self.peers.lock().unwrap(); - peers.peers.values().filter_map(|p| p.their_node_id).collect() + peers.peers.values().filter_map(|p| { + if !p.channel_encryptor.is_ready_for_encryption() || p.their_global_features.is_none() { + return None; + } + p.their_node_id + }).collect() } /// Indicates a new outbound connection has been established to a node with the given node_id.