Skip to content

Commit bf46a5f

Browse files
committed
Fix PeerManager::get_peer_node_ids to filter according to docs
1 parent 6dab6b1 commit bf46a5f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ln/peer_handler.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,12 @@ impl<Descriptor: SocketDescriptor> PeerManager<Descriptor> {
147147
/// completed and we are sure the remote peer has the private key for the given node_id.
148148
pub fn get_peer_node_ids(&self) -> Vec<PublicKey> {
149149
let peers = self.peers.lock().unwrap();
150-
peers.peers.values().filter_map(|p| p.their_node_id).collect()
150+
peers.peers.values().filter_map(|p| {
151+
if !p.channel_encryptor.is_ready_for_encryption() || p.their_global_features.is_none() {
152+
return None;
153+
}
154+
p.their_node_id
155+
}).collect()
151156
}
152157

153158
/// Indicates a new outbound connection has been established to a node with the given node_id.

0 commit comments

Comments
 (0)