@@ -491,6 +491,18 @@ impl_writeable_tlv_based_enum!(PaymentFailureReason,
491
491
( 10 , UnexpectedError ) => { } , ;
492
492
) ;
493
493
494
+ /// Used to indicate the kind of funding for this channel by the channel acceptor (us).
495
+ ///
496
+ /// Allows the differentiation between a request for a dual-funded and non-dual-funded channel.
497
+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
498
+ pub enum OpenChannelRequestAcceptorFunds {
499
+ /// For a non-dual-funded channel, the `push_msat` value from the channel initiator to us.
500
+ PushMsat ( u64 ) ,
501
+ /// Indicates the open request is for a dual funded channel and we may choose to contribute
502
+ /// funds to the channel.
503
+ DualFunded ,
504
+ }
505
+
494
506
/// An Event which you should probably take some action in response to.
495
507
///
496
508
/// Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
@@ -1069,14 +1081,28 @@ pub enum Event {
1069
1081
} ,
1070
1082
/// Indicates a request to open a new channel by a peer.
1071
1083
///
1072
- /// To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
1073
- /// call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
1074
- /// event will _not_ be triggered if the channel is rejected.
1084
+ /// If `our_funds` is `OpenChannelRequest::DualFunded`, this indicates that the peer wishes to
1085
+ /// open a dual-funded channel. In this case you can choose whether to contribute funds or not.
1086
+ /// Otherwise, `our_funds` will be `OpenChannelRequest::PushMsats`, indicating the `push_msats`
1087
+ /// value for a non-dual-funded channel.
1088
+ ///
1089
+ /// To accept the request (and in the case of a dual-funded channel, not contribute funds),
1090
+ /// call [`ChannelManager::accept_inbound_channel`].
1091
+ // TODO(dual_funding): Make this a doc comment when dual-funding fully released.
1092
+ // To accept the request and contribute funds for a dual-funded channel,
1093
+ // call [`ChannelManager::accept_inbound_channel_with_contribution`].
1094
+ /// To reject the request, call [`ChannelManager::force_close_without_broadcasting_txn`].
1095
+ /// Note that a ['ChannelClosed`] event will _not_ be triggered if the channel is rejected.
1075
1096
///
1076
1097
/// The event is only triggered when a new open channel request is received and the
1077
1098
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
1099
+ /// Note that if you wish to be able to contribute funds to dual-funded open channel requests,
1100
+ /// [`UserConfig::manually_accept_inbound_channels`] MUST be set to true so that you may
1101
+ /// provide funding inputs when choosing to contribute to the channel capacity.
1078
1102
///
1079
1103
/// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1104
+ // TODO(dual_funding): Make this a doc comment when dual-funding fully released.
1105
+ // [`ChannelManager::accept_inbound_channel_with_contribution`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_with_contribution
1080
1106
/// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1081
1107
/// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1082
1108
OpenChannelRequest {
@@ -1102,7 +1128,7 @@ pub enum Event {
1102
1128
/// The channel value of the requested channel.
1103
1129
funding_satoshis : u64 ,
1104
1130
/// Our starting balance in the channel if the request is accepted, in milli-satoshi.
1105
- push_msat : u64 ,
1131
+ acceptor_funds : OpenChannelRequestAcceptorFunds ,
1106
1132
/// The features that this channel will operate with. If you reject the channel, a
1107
1133
/// well-behaved counterparty may automatically re-attempt the channel with a new set of
1108
1134
/// feature flags.
0 commit comments