@@ -797,6 +797,59 @@ pub enum Event {
797
797
/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
798
798
channel_type : ChannelTypeFeatures ,
799
799
} ,
800
+ /// Indicates a request to open a new dual-funded channel by a peer.
801
+ ///
802
+ /// To accept the request, call [`ChannelManager::accept_inbound_dual_funded_channel`].
803
+ /// To reject the request, call [`ChannelManager::force_close_without_broadcasting_txn`].
804
+ ///
805
+ /// The event is always triggered when a new open channel request is received for a dual-funded
806
+ /// channel, regardless of the value of the [`UserConfig::manually_accept_inbound_channels`]
807
+ /// config flag. This is so that funding inputs can be manually provided to contribute to the
808
+ /// overall channel capacity on the acceptor side.
809
+ ///
810
+ /// [`ChannelManager::accept_inbound_dual_funded_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_dual_funded_channel
811
+ /// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
812
+ /// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
813
+ OpenChannelV2Request {
814
+ /// The temporary channel ID of the channel requested to be opened.
815
+ ///
816
+ /// When responding to the request, the `temporary_channel_id` should be passed
817
+ /// back to the ChannelManager through [`ChannelManager::accept_inbound_dual_funded_channel`] to
818
+ /// accept, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
819
+ ///
820
+ /// [`ChannelManager::accept_inbound_dual_funded_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_dual_funded_channel
821
+ /// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
822
+ temporary_channel_id : [ u8 ; 32 ] ,
823
+ /// The node_id of the counterparty requesting to open the channel.
824
+ ///
825
+ /// When responding to the request, the `counterparty_node_id` should be passed
826
+ /// back to the `ChannelManager` through [`ChannelManager::accept_inbound_dual_funded_channel`] to
827
+ /// accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
828
+ /// request.
829
+ ///
830
+ /// [`ChannelManager::accept_inbound_dual_funded_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_dual_funded_channel
831
+ /// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
832
+ counterparty_node_id : PublicKey ,
833
+ /// The counterparty's contribution to the channel value in satoshis.
834
+ funding_satoshis : u64 ,
835
+ /// The features that this channel will operate with. If you reject the channel, a
836
+ /// well-behaved counterparty may automatically re-attempt the channel with a new set of
837
+ /// feature flags.
838
+ ///
839
+ /// Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
840
+ /// the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
841
+ /// 0.0.106.
842
+ ///
843
+ /// Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
844
+ /// the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
845
+ /// 0.0.107.
846
+ ///
847
+ /// NOTE: Zero-conf dual-funded channels are not currently accepted.
848
+ // TODO(dual_funding): Support zero-conf channels.
849
+ ///
850
+ /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
851
+ channel_type : ChannelTypeFeatures ,
852
+ } ,
800
853
/// Indicates that the HTLC was accepted, but could not be processed when or after attempting to
801
854
/// forward it.
802
855
///
@@ -1039,6 +1092,12 @@ impl Writeable for Event {
1039
1092
( 8 , funding_txo, required) ,
1040
1093
} ) ;
1041
1094
} ,
1095
+ & Event :: OpenChannelV2Request { .. } => {
1096
+ 33u8 . write ( writer) ?;
1097
+ // We never write the OpenChannelV2Request events as, upon disconnection, peers
1098
+ // drop any channels which have not yet completed any interactive funding transaction
1099
+ // construction.
1100
+ } ,
1042
1101
// Note that, going forward, all new events must only write data inside of
1043
1102
// `write_tlv_fields`. Versions 0.0.101+ will ignore odd-numbered events that write
1044
1103
// data via `write_tlv_fields`.
0 commit comments