Skip to content

Commit

Permalink
Formatting: separate stfu msgs from splicing to its own group
Browse files Browse the repository at this point in the history
  • Loading branch information
optout21 committed Nov 7, 2023
1 parent e865e86 commit 6380a80
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions fuzz/src/bin/gen_target.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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::
1 change: 1 addition & 0 deletions fuzz/src/msg_targets/gen_target.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
3 changes: 2 additions & 1 deletion lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions lightning/src/ln/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion lightning/src/ln/peer_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1655,10 +1655,12 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
self.message_handler.chan_handler.handle_channel_ready(&their_node_id, &msg);
},

// Splicing messages:
// Quiescence messages:
wire::Message::Stfu(msg) => {
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);
}
Expand Down

0 comments on commit 6380a80

Please sign in to comment.