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