From 6380a806196970614506f6fabeda588b9c96dc68 Mon Sep 17 00:00:00 2001 From: optout <13562139+optout21@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:32:09 +0100 Subject: [PATCH] Formatting: separate stfu msgs from splicing to its own group --- fuzz/src/bin/gen_target.sh | 1 + fuzz/src/msg_targets/gen_target.sh | 1 + lightning/src/ln/channelmanager.rs | 3 ++- lightning/src/ln/msgs.rs | 6 ++++-- lightning/src/ln/peer_handler.rs | 4 +++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/fuzz/src/bin/gen_target.sh b/fuzz/src/bin/gen_target.sh index 2b2dbd275c2..62381622f6b 100755 --- a/fuzz/src/bin/gen_target.sh +++ b/fuzz/src/bin/gen_target.sh @@ -72,6 +72,7 @@ GEN_TEST msg_tx_ack_rbf msg_targets:: GEN_TEST msg_tx_abort msg_targets:: GEN_TEST msg_stfu msg_targets:: + GEN_TEST msg_splice msg_targets:: GEN_TEST msg_splice_ack msg_targets:: GEN_TEST msg_splice_locked msg_targets:: diff --git a/fuzz/src/msg_targets/gen_target.sh b/fuzz/src/msg_targets/gen_target.sh index 12ab8eaec12..cb24aa919db 100755 --- a/fuzz/src/msg_targets/gen_target.sh +++ b/fuzz/src/msg_targets/gen_target.sh @@ -60,6 +60,7 @@ GEN_TEST lightning::ln::msgs::TxAckRbf test_msg_simple "" GEN_TEST lightning::ln::msgs::TxAbort test_msg_simple "" GEN_TEST lightning::ln::msgs::Stfu test_msg_simple "" + GEN_TEST lightning::ln::msgs::Splice test_msg_simple "" GEN_TEST lightning::ln::msgs::SpliceAck test_msg_simple "" GEN_TEST lightning::ln::msgs::SpliceLocked test_msg_simple "" diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 2a432aadebd..07c1173a01b 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -8713,8 +8713,9 @@ where // Common Channel Establishment &events::MessageSendEvent::SendChannelReady { .. } => false, &events::MessageSendEvent::SendAnnouncementSignatures { .. } => false, - // Splicing + // Quiescence &events::MessageSendEvent::SendStfu { .. } => false, + // Splicing &events::MessageSendEvent::SendSplice { .. } => false, &events::MessageSendEvent::SendSpliceAck { .. } => false, &events::MessageSendEvent::SendSpliceLocked { .. } => false, diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs index 6c9b74b2b10..248401a1e8f 100644 --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@ -442,7 +442,7 @@ pub struct ChannelReady { } /// An stfu (quiescence) message to be sent by or received from the stfu initiator. -// TODO(splicing): Add spec link for `splice`; still in draft, using from https://github.com/lightning/bolts/pull/863 +// TODO(splicing): Add spec link for `stfu`; still in draft, using from https://github.com/lightning/bolts/pull/863 #[derive(Clone, Debug, PartialEq, Eq)] pub struct Stfu { /// The channel ID where quiescence is intended @@ -1463,9 +1463,11 @@ pub trait ChannelMessageHandler : MessageSendEventsProvider { /// Handle an incoming `closing_signed` message from the given peer. fn handle_closing_signed(&self, their_node_id: &PublicKey, msg: &ClosingSigned); - // Splicing + // Quiescence /// Handle an incoming `stfu` message from the given peer. fn handle_stfu(&self, their_node_id: &PublicKey, msg: &Stfu); + + // Splicing /// Handle an incoming `splice` message from the given peer. fn handle_splice(&self, their_node_id: &PublicKey, msg: &Splice); /// Handle an incoming `splice_ack` message from the given peer. diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs index b96d694a4fd..f4873095be6 100644 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@ -1655,10 +1655,12 @@ impl { self.message_handler.chan_handler.handle_stfu(&their_node_id, &msg); } + + // Splicing messages: wire::Message::Splice(msg) => { self.message_handler.chan_handler.handle_splice(&their_node_id, &msg); }