@@ -538,6 +538,18 @@ impl_writeable_tlv_based_enum!(PaymentFailureReason,
538
538
( 10 , UnexpectedError ) => { } , ;
539
539
) ;
540
540
541
+ /// Used to indicate the kind of funding for this channel by the channel acceptor (us).
542
+ ///
543
+ /// Allows the differentiation between a request for a dual-funded and non-dual-funded channel.
544
+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
545
+ pub enum OpenChannelRequestAcceptorFunds {
546
+ /// For a non-dual-funded channel, the `push_msat` value from the channel initiator to us.
547
+ PushMsat ( u64 ) ,
548
+ /// Indicates the open request is for a dual funded channel and we may choose to contribute
549
+ /// funds to the channel.
550
+ DualFunded ,
551
+ }
552
+
541
553
/// An Event which you should probably take some action in response to.
542
554
///
543
555
/// Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
@@ -1141,14 +1153,28 @@ pub enum Event {
1141
1153
} ,
1142
1154
/// Indicates a request to open a new channel by a peer.
1143
1155
///
1144
- /// To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
1145
- /// call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
1146
- /// event will _not_ be triggered if the channel is rejected.
1156
+ /// If `our_funds` is `OpenChannelRequest::DualFunded`, this indicates that the peer wishes to
1157
+ /// open a dual-funded channel. In this case you can choose whether to contribute funds or not.
1158
+ /// Otherwise, `our_funds` will be `OpenChannelRequest::PushMsats`, indicating the `push_msats`
1159
+ /// value for a non-dual-funded channel.
1160
+ ///
1161
+ /// To accept the request (and in the case of a dual-funded channel, not contribute funds),
1162
+ /// call [`ChannelManager::accept_inbound_channel`].
1163
+ // TODO(dual_funding): Make this a doc comment when dual-funding fully released.
1164
+ // To accept the request and contribute funds for a dual-funded channel,
1165
+ // call [`ChannelManager::accept_inbound_channel_with_contribution`].
1166
+ /// To reject the request, call [`ChannelManager::force_close_without_broadcasting_txn`].
1167
+ /// Note that a ['ChannelClosed`] event will _not_ be triggered if the channel is rejected.
1147
1168
///
1148
1169
/// The event is only triggered when a new open channel request is received and the
1149
1170
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
1171
+ /// Note that if you wish to be able to contribute funds to dual-funded open channel requests,
1172
+ /// [`UserConfig::manually_accept_inbound_channels`] MUST be set to true so that you may
1173
+ /// provide funding inputs when choosing to contribute to the channel capacity.
1150
1174
///
1151
1175
/// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1176
+ // TODO(dual_funding): Make this a doc comment when dual-funding fully released.
1177
+ // [`ChannelManager::accept_inbound_channel_with_contribution`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_with_contribution
1152
1178
/// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1153
1179
/// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1154
1180
OpenChannelRequest {
@@ -1174,7 +1200,7 @@ pub enum Event {
1174
1200
/// The channel value of the requested channel.
1175
1201
funding_satoshis : u64 ,
1176
1202
/// Our starting balance in the channel if the request is accepted, in milli-satoshi.
1177
- push_msat : u64 ,
1203
+ acceptor_funds : OpenChannelRequestAcceptorFunds ,
1178
1204
/// The features that this channel will operate with. If you reject the channel, a
1179
1205
/// well-behaved counterparty may automatically re-attempt the channel with a new set of
1180
1206
/// feature flags.
0 commit comments