X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fpeer_handler.rs;h=dffda9967badfe28b5afb3d2ebc0a3a4457e18fd;hb=bcf174034a23f93a56aa20001602cd0645361b16;hp=d851d29d46cd80e9d608fb951bc535e0c231649b;hpb=d8a20eda5f74126d96700263716ee3938d4d3c8d;p=rust-lightning diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs index d851d29d..dffda996 100644 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@ -173,10 +173,10 @@ impl MessageSendEventsProvider for ErroringMessageHandler { impl ChannelMessageHandler for ErroringMessageHandler { // Any messages which are related to a specific channel generate an error message to let the // peer know we don't care about channels. - fn handle_open_channel(&self, their_node_id: &PublicKey, _their_features: InitFeatures, msg: &msgs::OpenChannel) { + fn handle_open_channel(&self, their_node_id: &PublicKey, msg: &msgs::OpenChannel) { ErroringMessageHandler::push_error(self, their_node_id, msg.temporary_channel_id); } - fn handle_accept_channel(&self, their_node_id: &PublicKey, _their_features: InitFeatures, msg: &msgs::AcceptChannel) { + fn handle_accept_channel(&self, their_node_id: &PublicKey, msg: &msgs::AcceptChannel) { ErroringMessageHandler::push_error(self, their_node_id, msg.temporary_channel_id); } fn handle_funding_created(&self, their_node_id: &PublicKey, msg: &msgs::FundingCreated) { @@ -188,7 +188,7 @@ impl ChannelMessageHandler for ErroringMessageHandler { fn handle_channel_ready(&self, their_node_id: &PublicKey, msg: &msgs::ChannelReady) { ErroringMessageHandler::push_error(self, their_node_id, msg.channel_id); } - fn handle_shutdown(&self, their_node_id: &PublicKey, _their_features: &InitFeatures, msg: &msgs::Shutdown) { + fn handle_shutdown(&self, their_node_id: &PublicKey, msg: &msgs::Shutdown) { ErroringMessageHandler::push_error(self, their_node_id, msg.channel_id); } fn handle_closing_signed(&self, their_node_id: &PublicKey, msg: &msgs::ClosingSigned) { @@ -644,7 +644,7 @@ impl PeerManager" for an optional pubkey. +/// A simple wrapper that optionally prints ` from ` for an optional pubkey. /// This works around `format!()` taking a reference to each argument, preventing /// `if let Some(node_id) = peer.their_node_id { format!(.., node_id) } else { .. }` from compiling /// due to lifetime errors. @@ -656,8 +656,8 @@ impl core::fmt::Display for OptionalFromDebugger<'_> { } /// A function used to filter out local or private addresses -/// https://www.iana.org./assignments/ipv4-address-space/ipv4-address-space.xhtml -/// https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml +/// +/// fn filter_addresses(ip_address: Option) -> Option { match ip_address{ // For IPv4 range 10.0.0.0 - 10.255.255.255 (10/8) @@ -1272,7 +1272,6 @@ impl { - self.message_handler.chan_handler.handle_open_channel(&their_node_id, their_features.clone().unwrap(), &msg); + self.message_handler.chan_handler.handle_open_channel(&their_node_id, &msg); }, wire::Message::AcceptChannel(msg) => { - self.message_handler.chan_handler.handle_accept_channel(&their_node_id, their_features.clone().unwrap(), &msg); + self.message_handler.chan_handler.handle_accept_channel(&their_node_id, &msg); }, wire::Message::FundingCreated(msg) => { @@ -1357,7 +1356,7 @@ impl { - self.message_handler.chan_handler.handle_shutdown(&their_node_id, their_features.as_ref().unwrap(), &msg); + self.message_handler.chan_handler.handle_shutdown(&their_node_id, &msg); }, wire::Message::ClosingSigned(msg) => { self.message_handler.chan_handler.handle_closing_signed(&their_node_id, &msg);