@@ -25,6 +25,7 @@ use crate::blinded_path::payment::{
2525use crate :: chain:: transaction;
2626use crate :: ln:: channel:: FUNDING_CONF_DEADLINE_BLOCKS ;
2727use crate :: ln:: channelmanager:: { InterceptId , PaymentId , RecipientOnionFields } ;
28+ use crate :: ln:: funding:: FundingTemplate ;
2829use crate :: ln:: types:: ChannelId ;
2930use crate :: ln:: { msgs, LocalHTLCFailureReason } ;
3031use crate :: offers:: invoice:: Bolt12Invoice ;
@@ -1816,6 +1817,28 @@ pub enum Event {
18161817 /// [`ChannelManager::respond_to_static_invoice_request`]: crate::ln::channelmanager::ChannelManager::respond_to_static_invoice_request
18171818 invoice_request : InvoiceRequest ,
18181819 } ,
1820+ ///
1821+ FundingNeeded {
1822+ /// The `channel_id` of the channel which you'll need to pass back into
1823+ /// [`ChannelManager::funding_contributed`].
1824+ ///
1825+ /// [`ChannelManager::funding_contributed`]: crate::ln::channelmanager::ChannelManager::funding_contributed
1826+ channel_id : ChannelId ,
1827+ /// The counterparty's `node_id`, which you'll need to pass back into
1828+ /// [`ChannelManager::funding_contributed`].
1829+ ///
1830+ /// [`ChannelManager::funding_contributed`]: crate::ln::channelmanager::ChannelManager::funding_contributed
1831+ counterparty_node_id : PublicKey ,
1832+ /// The `user_channel_id` value passed in for outbound channels, or for inbound channels if
1833+ /// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1834+ /// `user_channel_id` will be randomized for inbound channels.
1835+ ///
1836+ /// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1837+ user_channel_id : u128 ,
1838+
1839+ ///
1840+ funding_template : FundingTemplate ,
1841+ } ,
18191842 /// Indicates that a channel funding transaction constructed interactively is ready to be
18201843 /// signed. This event will only be triggered if at least one input was contributed.
18211844 ///
@@ -2347,6 +2370,20 @@ impl Writeable for Event {
23472370 ( 13 , * contributed_outputs, optional_vec) ,
23482371 } ) ;
23492372 } ,
2373+ & Event :: FundingNeeded {
2374+ ref channel_id,
2375+ ref user_channel_id,
2376+ ref counterparty_node_id,
2377+ ref funding_template,
2378+ } => {
2379+ 54u8 . write ( writer) ?;
2380+ write_tlv_fields ! ( writer, {
2381+ ( 1 , channel_id, required) ,
2382+ ( 3 , user_channel_id, required) ,
2383+ ( 5 , counterparty_node_id, required) ,
2384+ ( 7 , funding_template, required) ,
2385+ } ) ;
2386+ } ,
23502387 // Note that, going forward, all new events must only write data inside of
23512388 // `write_tlv_fields`. Versions 0.0.101+ will ignore odd-numbered events that write
23522389 // data via `write_tlv_fields`.
@@ -2978,6 +3015,24 @@ impl MaybeReadable for Event {
29783015 } ;
29793016 f ( )
29803017 } ,
3018+ 54u8 => {
3019+ let mut f = || {
3020+ _init_and_read_len_prefixed_tlv_fields ! ( reader, {
3021+ ( 1 , channel_id, required) ,
3022+ ( 3 , user_channel_id, required) ,
3023+ ( 5 , counterparty_node_id, required) ,
3024+ ( 7 , funding_template, required) ,
3025+ } ) ;
3026+
3027+ Ok ( Some ( Event :: FundingNeeded {
3028+ channel_id : channel_id. 0 . unwrap ( ) ,
3029+ user_channel_id : user_channel_id. 0 . unwrap ( ) ,
3030+ counterparty_node_id : counterparty_node_id. 0 . unwrap ( ) ,
3031+ funding_template : funding_template. 0 . unwrap ( ) ,
3032+ } ) )
3033+ } ;
3034+ f ( )
3035+ } ,
29813036 // Versions prior to 0.0.100 did not ignore odd types, instead returning InvalidValue.
29823037 // Version 0.0.100 failed to properly ignore odd types, possibly resulting in corrupt
29833038 // reads.
0 commit comments