Skip to content

Commit 7a49327

Browse files
committed
f docs and serialization for message
1 parent 1d4c966 commit 7a49327

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

lightning/src/events/mod.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,11 @@ pub enum ClosureReason {
318318
/// [`UntrustedString`]: crate::util::string::UntrustedString
319319
peer_msg: UntrustedString,
320320
},
321-
/// Closure generated from [`ChannelManager::force_close_channel`], called by the user.
321+
/// Closure generated from [`ChannelManager::force_close_broadcasting_latest_txn`] or
322+
/// [`ChannelManager::force_close_all_channels_broadcasting_latest_txn`], called by the user.
322323
///
323-
/// [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
324+
/// [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn
325+
/// [`ChannelManager::force_close_all_channels_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_all_channels_broadcasting_latest_txn
324326
HolderForceClosed {
325327
/// Whether or not the latest transaction was broadcasted when the channel was force
326328
/// closed.
@@ -335,7 +337,13 @@ pub enum ClosureReason {
335337
/// [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn.
336338
/// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn.
337339
broadcasted_latest_txn: Option<bool>,
338-
/// XXX: What was passed to force_close!
340+
/// The error message provided to [`ChannelManager::force_close_broadcasting_latest_txn`] or
341+
/// [`ChannelManager::force_close_all_channels_broadcasting_latest_txn`].
342+
///
343+
/// This will be the empty string for objects generated or written by LDK 0.1 and earlier.
344+
///
345+
/// [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn
346+
/// [`ChannelManager::force_close_all_channels_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_all_channels_broadcasting_latest_txn
339347
message: String,
340348
},
341349
/// The channel was closed after negotiating a cooperative close and we've now broadcasted
@@ -487,7 +495,7 @@ impl_writeable_tlv_based_enum_upgradable!(ClosureReason,
487495
(1, FundingTimedOut) => {},
488496
(2, HolderForceClosed) => {
489497
(1, broadcasted_latest_txn, option),
490-
(3, message, required), // XXX: upgrade to empty string or whatever and document
498+
(3, message, (default_value, String::new())),
491499
},
492500
(6, CommitmentTxConfirmed) => {},
493501
(4, LegacyCooperativeClosure) => {},

0 commit comments

Comments
 (0)