Skip to content

Commit

Permalink
Batch funding for v1 channel establishments
Browse files Browse the repository at this point in the history
  • Loading branch information
wvanlint committed Sep 20, 2023
1 parent 51d5ead commit 570a1c7
Show file tree
Hide file tree
Showing 6 changed files with 968 additions and 85 deletions.
7 changes: 7 additions & 0 deletions lightning/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ pub enum ClosureReason {
/// The counterparty requested a cooperative close of a channel that had not been funded yet.
/// The channel has been immediately closed.
CounterpartyCoopClosedUnfundedChannel,
/// Another channel in the same funding batch closed before the funding transaction
/// was ready to be broadcast.
FundingBatchClosure,
}

impl core::fmt::Display for ClosureReason {
Expand All @@ -219,6 +222,7 @@ impl core::fmt::Display for ClosureReason {
ClosureReason::DisconnectedPeer => f.write_str("the peer disconnected prior to the channel being funded"),
ClosureReason::OutdatedChannelManager => f.write_str("the ChannelManager read from disk was stale compared to ChannelMonitor(s)"),
ClosureReason::CounterpartyCoopClosedUnfundedChannel => f.write_str("the peer requested the unfunded channel be closed"),
ClosureReason::FundingBatchClosure => f.write_str("another channel in the same funding batch closed"),
}
}
}
Expand All @@ -233,6 +237,7 @@ impl_writeable_tlv_based_enum_upgradable!(ClosureReason,
(10, DisconnectedPeer) => {},
(12, OutdatedChannelManager) => {},
(13, CounterpartyCoopClosedUnfundedChannel) => {},
(15, FundingBatchClosure) => {}
);

/// Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
Expand Down Expand Up @@ -844,6 +849,8 @@ pub enum Event {
},
/// Used to indicate to the user that they can abandon the funding transaction and recycle the
/// inputs for another purpose.
///
/// This event is not guaranteed to be generated for channels that are closed due to a restart.
DiscardFunding {
/// The channel_id of the channel which has been closed.
channel_id: ChannelId,
Expand Down
Loading

0 comments on commit 570a1c7

Please sign in to comment.