Require option_static_remotekey in channel/channelmonitor.
[rust-lightning] / lightning / src / ln / peer_handler.rs
index 02bb2625b1519269aad4a8333ddd466ff75e2948..36c9bf5e9acd2bfe0a7ea71b03e8983d0514a67a 100644 (file)
@@ -641,6 +641,10 @@ impl<Descriptor: SocketDescriptor, CM: Deref> PeerManager<Descriptor, CM> where
                                                                                                        peer.sync_status = InitSyncTracker::ChannelsSyncing(0);
                                                                                                        peers.peers_needing_send.insert(peer_descriptor.clone());
                                                                                                }
+                                                                                               if !msg.features.supports_static_remote_key() {
+                                                                                                       log_debug!(self, "Peer {} does not support static remote key, disconnecting with no_connection_possible", log_pubkey!(peer.their_node_id.unwrap()));
+                                                                                                       return Err(PeerHandleError{ no_connection_possible: true });
+                                                                                               }
 
                                                                                                if !peer.outbound {
                                                                                                        let mut features = InitFeatures::known();