Improve routing-related documentation
[rust-lightning] / lightning / src / ln / peer_handler.rs
index 02bb2625b1519269aad4a8333ddd466ff75e2948..11c6c4d4c2da29d05206c6fea5548d57f1d914c7 100644 (file)
@@ -3,7 +3,7 @@
 //! Instead of actually servicing sockets ourselves we require that you implement the
 //! SocketDescriptor interface and use that to receive actions which you should perform on the
 //! socket, and call into PeerManager with bytes read from the socket. The PeerManager will then
-//! call into the provided message handlers (probably a ChannelManager and Router) with messages
+//! call into the provided message handlers (probably a ChannelManager and NetGraphmsgHandler) with messages
 //! they should handle, and encoding/sending response messages.
 
 use bitcoin::secp256k1::key::{SecretKey,PublicKey};
@@ -36,7 +36,7 @@ pub struct MessageHandler<CM: Deref> where CM::Target: msgs::ChannelMessageHandl
        /// ChannelManager object.
        pub chan_handler: CM,
        /// A message handler which handles messages updating our knowledge of the network channel
-       /// graph. Usually this is just a Router object.
+       /// graph. Usually this is just a NetGraphMsgHandlerMonitor object.
        pub route_handler: Arc<msgs::RoutingMessageHandler>,
 }
 
@@ -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();