From bf46a5f721ec7ab4c4b7a466bd8f25951f6af9a4 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 8 Sep 2018 13:57:20 -0400 Subject: [PATCH] Fix PeerManager::get_peer_node_ids to filter according to docs --- src/ln/peer_handler.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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. -- 2.39.5