@@ -1698,6 +1698,52 @@ pub enum Event {
1698
1698
/// [`ChannelManager::send_static_invoice`]: crate::ln::channelmanager::ChannelManager::send_static_invoice
1699
1699
reply_path : Responder ,
1700
1700
} ,
1701
+ /// Indicates that a channel funding transaction constructed interactively is ready to be
1702
+ /// signed. This event will only be triggered if at least one input was contributed.
1703
+ ///
1704
+ /// The transaction contains all inputs and outputs provided by both parties including the
1705
+ /// channel's funding output and a change output if applicable.
1706
+ ///
1707
+ /// No part of the transaction should be changed before signing as the content of the transaction
1708
+ /// has already been negotiated with the counterparty.
1709
+ ///
1710
+ /// Each signature MUST use the `SIGHASH_ALL` flag to avoid invalidation of the initial commitment and
1711
+ /// hence possible loss of funds.
1712
+ ///
1713
+ /// After signing, call [`ChannelManager::funding_transaction_signed`] with the (partially) signed
1714
+ /// funding transaction.
1715
+ ///
1716
+ /// Generated in [`ChannelManager`] message handling.
1717
+ ///
1718
+ /// # Failure Behavior and Persistence
1719
+ /// This event will eventually be replayed after failures-to-handle (i.e., the event handler
1720
+ /// returning `Err(ReplayEvent ())`), but will only be regenerated as needed after restarts.
1721
+ ///
1722
+ /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
1723
+ /// [`ChannelManager::funding_transaction_signed`]: crate::ln::channelmanager::ChannelManager::funding_transaction_signed
1724
+ FundingTransactionReadyForSigning {
1725
+ /// The `channel_id` of the channel which you'll need to pass back into
1726
+ /// [`ChannelManager::funding_transaction_signed`].
1727
+ ///
1728
+ /// [`ChannelManager::funding_transaction_signed`]: crate::ln::channelmanager::ChannelManager::funding_transaction_signed
1729
+ channel_id : ChannelId ,
1730
+ /// The counterparty's `node_id`, which you'll need to pass back into
1731
+ /// [`ChannelManager::funding_transaction_signed`].
1732
+ ///
1733
+ /// [`ChannelManager::funding_transaction_signed`]: crate::ln::channelmanager::ChannelManager::funding_transaction_signed
1734
+ counterparty_node_id : PublicKey ,
1735
+ /// The `user_channel_id` value passed in for outbound channels, or for inbound channels if
1736
+ /// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1737
+ /// `user_channel_id` will be randomized for inbound channels.
1738
+ ///
1739
+ /// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1740
+ user_channel_id : u128 ,
1741
+ /// The unsigned transaction to be signed and passed back to
1742
+ /// [`ChannelManager::funding_transaction_signed`].
1743
+ ///
1744
+ /// [`ChannelManager::funding_transaction_signed`]: crate::ln::channelmanager::ChannelManager::funding_transaction_signed
1745
+ unsigned_transaction : Transaction ,
1746
+ } ,
1701
1747
}
1702
1748
1703
1749
impl Writeable for Event {
@@ -2140,6 +2186,11 @@ impl Writeable for Event {
2140
2186
47u8 . write ( writer) ?;
2141
2187
// Never write StaticInvoiceRequested events as buffered onion messages aren't serialized.
2142
2188
} ,
2189
+ & Event :: FundingTransactionReadyForSigning { .. } => {
2190
+ 49u8 . write ( writer) ?;
2191
+ // We never write out FundingTransactionReadyForSigning events as they will be regenerated when
2192
+ // necessary.
2193
+ } ,
2143
2194
// Note that, going forward, all new events must only write data inside of
2144
2195
// `write_tlv_fields`. Versions 0.0.101+ will ignore odd-numbered events that write
2145
2196
// data via `write_tlv_fields`.
@@ -2722,6 +2773,8 @@ impl MaybeReadable for Event {
2722
2773
// Note that we do not write a length-prefixed TLV for StaticInvoiceRequested events.
2723
2774
#[ cfg( async_payments) ]
2724
2775
47u8 => Ok ( None ) ,
2776
+ // Note that we do not write a length-prefixed TLV for FundingTransactionReadyForSigning events.
2777
+ 49u8 => Ok ( None ) ,
2725
2778
// Versions prior to 0.0.100 did not ignore odd types, instead returning InvalidValue.
2726
2779
// Version 0.0.100 failed to properly ignore odd types, possibly resulting in corrupt
2727
2780
// reads.
0 commit comments