Skip to content

Commit

Permalink
Rebase to latest dual funding branch (2023)
Browse files Browse the repository at this point in the history
  • Loading branch information
optout21 committed May 17, 2024
1 parent 986b66d commit 0212c99
Show file tree
Hide file tree
Showing 7 changed files with 542 additions and 365 deletions.
11 changes: 11 additions & 0 deletions lightning-net-tokio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,9 @@ mod tests {
fn handle_update_fee(&self, _their_node_id: &PublicKey, _msg: &UpdateFee) {}
fn handle_announcement_signatures(&self, _their_node_id: &PublicKey, _msg: &AnnouncementSignatures) {}
fn handle_channel_update(&self, _their_node_id: &PublicKey, _msg: &ChannelUpdate) {}
#[cfg(any(dual_funding, splicing))]
fn handle_open_channel_v2(&self, _their_node_id: &PublicKey, _msg: &OpenChannelV2) {}
#[cfg(any(dual_funding, splicing))]
fn handle_accept_channel_v2(&self, _their_node_id: &PublicKey, _msg: &AcceptChannelV2) {}
fn handle_stfu(&self, _their_node_id: &PublicKey, _msg: &Stfu) {}
#[cfg(splicing)]
Expand All @@ -630,14 +632,23 @@ mod tests {
fn handle_splice_ack(&self, _their_node_id: &PublicKey, _msg: &SpliceAck) {}
#[cfg(splicing)]
fn handle_splice_locked(&self, _their_node_id: &PublicKey, _msg: &SpliceLocked) {}
#[cfg(any(dual_funding, splicing))]
fn handle_tx_add_input(&self, _their_node_id: &PublicKey, _msg: &TxAddInput) {}
#[cfg(any(dual_funding, splicing))]
fn handle_tx_add_output(&self, _their_node_id: &PublicKey, _msg: &TxAddOutput) {}
#[cfg(any(dual_funding, splicing))]
fn handle_tx_remove_input(&self, _their_node_id: &PublicKey, _msg: &TxRemoveInput) {}
#[cfg(any(dual_funding, splicing))]
fn handle_tx_remove_output(&self, _their_node_id: &PublicKey, _msg: &TxRemoveOutput) {}
#[cfg(any(dual_funding, splicing))]
fn handle_tx_complete(&self, _their_node_id: &PublicKey, _msg: &TxComplete) {}
#[cfg(any(dual_funding, splicing))]
fn handle_tx_signatures(&self, _their_node_id: &PublicKey, _msg: &TxSignatures) {}
#[cfg(any(dual_funding, splicing))]
fn handle_tx_init_rbf(&self, _their_node_id: &PublicKey, _msg: &TxInitRbf) {}
#[cfg(any(dual_funding, splicing))]
fn handle_tx_ack_rbf(&self, _their_node_id: &PublicKey, _msg: &TxAckRbf) {}
#[cfg(any(dual_funding, splicing))]
fn handle_tx_abort(&self, _their_node_id: &PublicKey, _msg: &TxAbort) {}
fn peer_disconnected(&self, their_node_id: &PublicKey) {
if *their_node_id == self.expected_pubkey {
Expand Down
18 changes: 10 additions & 8 deletions lightning/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,7 @@ pub enum Event {
///
/// [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
BumpTransaction(BumpTransactionEvent),
/* Note: FundingInputsContributionReady event has been abandoned
/// Used to indicate that the client should provide inputs to fund a dual-funded channel using
/// interactive transaction construction by calling [`ChannelManager::contribute_funding_inputs`].
/// Generated in [`ChannelManager`] message handling.
Expand Down Expand Up @@ -1246,6 +1247,7 @@ pub enum Event {
/// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
user_channel_id: u128,
},
*/
/// Indicates that a transaction constructed via interactive transaction construction for a
/// dual-funded (V2) channel is ready to be signed by the client. This event will only be triggered
/// if at least one input was contributed by the holder.
Expand Down Expand Up @@ -1599,16 +1601,16 @@ impl Writeable for Event {
35u8.write(writer)?;
// Never write ConnectionNeeded events as buffered onion messages aren't serialized.
},
#[cfg(any(dual_funding, splicing))]
&Event::FundingInputsContributionReady { .. } => {
37u8.write(writer)?;
// We never write out FundingInputsContributionReady events as, upon disconnection, peers
// drop any channels which have not yet exchanged the initial commitment_signed in V2 channel
// establishment.
},
// #[cfg(any(dual_funding, splicing))]
// &Event::FundingInputsContributionReady { .. } => {
// 37u8.write(writer)?;
// // We never write out FundingInputsContributionReady events as, upon disconnection, peers
// // drop any channels which have not yet exchanged the initial commitment_signed in V2 channel
// // establishment.
// },
#[cfg(any(dual_funding, splicing))]
&Event::OpenChannelV2Request { .. } => {
39u8.write(writer)?;
37u8.write(writer)?;
// We never write the OpenChannelV2Request events as, upon disconnection, peers
// drop any channels which have not yet completed any interactive funding transaction
// construction.
Expand Down
Loading

0 comments on commit 0212c99

Please sign in to comment.