@@ -536,6 +536,18 @@ impl_writeable_tlv_based_enum!(PaymentFailureReason,
536
536
( 10 , UnexpectedError ) => { } , ;
537
537
) ;
538
538
539
+ /// Used to indicate the kind of funding for this channel by the channel acceptor (us).
540
+ ///
541
+ /// Allows the differentiation between a request for a dual-funded and non-dual-funded channel.
542
+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
543
+ pub enum OpenChannelRequestAcceptorFunds {
544
+ /// For a non-dual-funded channel, the `push_msat` value from the channel initiator to us.
545
+ PushMsat ( u64 ) ,
546
+ /// Indicates the open request is for a dual funded channel and we may choose to contribute
547
+ /// funds to the channel.
548
+ DualFunded ,
549
+ }
550
+
539
551
/// An Event which you should probably take some action in response to.
540
552
///
541
553
/// Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
@@ -1114,14 +1126,28 @@ pub enum Event {
1114
1126
} ,
1115
1127
/// Indicates a request to open a new channel by a peer.
1116
1128
///
1117
- /// To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
1118
- /// call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
1119
- /// event will _not_ be triggered if the channel is rejected.
1129
+ /// If `our_funds` is `OpenChannelRequest::DualFunded`, this indicates that the peer wishes to
1130
+ /// open a dual-funded channel. In this case you can choose whether to contribute funds or not.
1131
+ /// Otherwise, `our_funds` will be `OpenChannelRequest::PushMsats`, indicating the `push_msats`
1132
+ /// value for a non-dual-funded channel.
1133
+ ///
1134
+ /// To accept the request (and in the case of a dual-funded channel, not contribute funds),
1135
+ /// call [`ChannelManager::accept_inbound_channel`].
1136
+ // TODO(dual_funding): Make this a doc comment when dual-funding fully released.
1137
+ // To accept the request and contribute funds for a dual-funded channel,
1138
+ // call [`ChannelManager::accept_inbound_channel_with_contribution`].
1139
+ /// To reject the request, call [`ChannelManager::force_close_without_broadcasting_txn`].
1140
+ /// Note that a ['ChannelClosed`] event will _not_ be triggered if the channel is rejected.
1120
1141
///
1121
1142
/// The event is only triggered when a new open channel request is received and the
1122
1143
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
1144
+ /// Note that if you wish to be able to contribute funds to dual-funded open channel requests,
1145
+ /// [`UserConfig::manually_accept_inbound_channels`] MUST be set to true so that you may
1146
+ /// provide funding inputs when choosing to contribute to the channel capacity.
1123
1147
///
1124
1148
/// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1149
+ // TODO(dual_funding): Make this a doc comment when dual-funding fully released.
1150
+ // [`ChannelManager::accept_inbound_channel_with_contribution`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_with_contribution
1125
1151
/// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
1126
1152
/// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1127
1153
OpenChannelRequest {
@@ -1147,7 +1173,7 @@ pub enum Event {
1147
1173
/// The channel value of the requested channel.
1148
1174
funding_satoshis : u64 ,
1149
1175
/// Our starting balance in the channel if the request is accepted, in milli-satoshi.
1150
- push_msat : u64 ,
1176
+ acceptor_funds : OpenChannelRequestAcceptorFunds ,
1151
1177
/// The features that this channel will operate with. If you reject the channel, a
1152
1178
/// well-behaved counterparty may automatically re-attempt the channel with a new set of
1153
1179
/// feature flags.
0 commit comments