@@ -812,6 +812,59 @@ pub enum Event {
812
812
/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
813
813
channel_type : ChannelTypeFeatures ,
814
814
} ,
815
+ /// Indicates a request to open a new dual-funded channel by a peer.
816
+ ///
817
+ /// To accept the request, call [`ChannelManager::accept_inbound_dual_funded_channel`].
818
+ /// To reject the request, call [`ChannelManager::force_close_without_broadcasting_txn`].
819
+ ///
820
+ /// The event is always triggered when a new open channel request is received for a dual-funded
821
+ /// channel, regardless of the value of the [`UserConfig::manually_accept_inbound_channels`]
822
+ /// config flag. This is so that funding inputs can be manually provided to contribute to the
823
+ /// overall channel capacity on the acceptor side.
824
+ ///
825
+ /// [`ChannelManager::accept_inbound_dual_funded_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_dual_funded_channel
826
+ /// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
827
+ /// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
828
+ OpenChannelV2Request {
829
+ /// The temporary channel ID of the channel requested to be opened.
830
+ ///
831
+ /// When responding to the request, the `temporary_channel_id` should be passed
832
+ /// back to the ChannelManager through [`ChannelManager::accept_inbound_dual_funded_channel`] to
833
+ /// accept, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
834
+ ///
835
+ /// [`ChannelManager::accept_inbound_dual_funded_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_dual_funded_channel
836
+ /// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
837
+ temporary_channel_id : [ u8 ; 32 ] ,
838
+ /// The node_id of the counterparty requesting to open the channel.
839
+ ///
840
+ /// When responding to the request, the `counterparty_node_id` should be passed
841
+ /// back to the `ChannelManager` through [`ChannelManager::accept_inbound_dual_funded_channel`] to
842
+ /// accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
843
+ /// request.
844
+ ///
845
+ /// [`ChannelManager::accept_inbound_dual_funded_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_dual_funded_channel
846
+ /// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
847
+ counterparty_node_id : PublicKey ,
848
+ /// The counterparty's contribution to the channel value in satoshis.
849
+ funding_satoshis : u64 ,
850
+ /// The features that this channel will operate with. If you reject the channel, a
851
+ /// well-behaved counterparty may automatically re-attempt the channel with a new set of
852
+ /// feature flags.
853
+ ///
854
+ /// Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
855
+ /// the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
856
+ /// 0.0.106.
857
+ ///
858
+ /// Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
859
+ /// the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
860
+ /// 0.0.107.
861
+ ///
862
+ /// NOTE: Zero-conf dual-funded channels are not currently accepted.
863
+ // TODO(dual_funding): Support zero-conf channels.
864
+ ///
865
+ /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
866
+ channel_type : ChannelTypeFeatures ,
867
+ } ,
815
868
/// Indicates that the HTLC was accepted, but could not be processed when or after attempting to
816
869
/// forward it.
817
870
///
@@ -1055,6 +1108,12 @@ impl Writeable for Event {
1055
1108
( 8 , funding_txo, required) ,
1056
1109
} ) ;
1057
1110
} ,
1111
+ & Event :: OpenChannelV2Request { .. } => {
1112
+ 33u8 . write ( writer) ?;
1113
+ // We never write the OpenChannelV2Request events as, upon disconnection, peers
1114
+ // drop any channels which have not yet completed any interactive funding transaction
1115
+ // construction.
1116
+ } ,
1058
1117
// Note that, going forward, all new events must only write data inside of
1059
1118
// `write_tlv_fields`. Versions 0.0.101+ will ignore odd-numbered events that write
1060
1119
// data via `write_tlv_fields`.
0 commit comments