Skip to content

Commit 54010cd

Browse files
committed
Batch funding for v1 channel establishments
1 parent 073f078 commit 54010cd

File tree

6 files changed

+989
-83
lines changed

6 files changed

+989
-83
lines changed

lightning/src/events/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ pub enum ClosureReason {
199199
/// The counterparty requested a cooperative close of a channel that had not been funded yet.
200200
/// The channel has been immediately closed.
201201
CounterpartyCoopClosedUnfundedChannel,
202+
/// Another channel in the same funding batch closed before the funding transaction
203+
/// was ready to be broadcast.
204+
FundingBatchClosure,
202205
}
203206

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

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

0 commit comments

Comments
 (0)