@@ -606,6 +606,20 @@ impl_writeable_tlv_based_enum_upgradable!(PaymentFailureReason,
606
606
( 10 , UnexpectedError ) => { } ,
607
607
) ;
608
608
609
+ /// Used to indicate the kind of funding for this channel by the channel acceptor (us).
610
+ ///
611
+ /// Allows the differentiation between a request for a dual-funded and non-dual-funded channel.
612
+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
613
+ pub enum InboundChannelFunds {
614
+ /// For a non-dual-funded channel, the `push_msat` value from the channel initiator to us.
615
+ PushMsat ( u64 ) ,
616
+ /// Indicates the open request is for a dual funded channel.
617
+ ///
618
+ /// Note that these channels do not support starting with initial funds pushed from the counterparty,
619
+ /// who is the channel opener in this case.
620
+ DualFunded ,
621
+ }
622
+
609
623
/// An Event which you should probably take some action in response to.
610
624
///
611
625
/// Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
@@ -1337,16 +1351,17 @@ pub enum Event {
1337
1351
} ,
1338
1352
/// Indicates a request to open a new channel by a peer.
1339
1353
///
1340
- /// To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
1341
- /// call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
1342
- /// event will _not_ be triggered if the channel is rejected.
1354
+ /// To accept the request (and in the case of a dual-funded channel, not contribute funds),
1355
+ /// call [`ChannelManager::accept_inbound_channel`].
1356
+ /// To reject the request, call [`ChannelManager::force_close_without_broadcasting_txn`].
1357
+ /// Note that a ['ChannelClosed`] event will _not_ be triggered if the channel is rejected.
1343
1358
///
1344
1359
/// The event is only triggered when a new open channel request is received and the
1345
1360
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
1346
1361
///
1347
1362
/// # Failure Behavior and Persistence
1348
1363
/// This event will eventually be replayed after failures-to-handle (i.e., the event handler
1349
- /// returning `Err(ReplayEvent ())`) and will be persisted across restarts.
1364
+ /// returning `Err(ReplayEvent ())`) and won't be persisted across restarts.
1350
1365
///
1351
1366
/// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1352
1367
/// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
@@ -1373,8 +1388,10 @@ pub enum Event {
1373
1388
counterparty_node_id : PublicKey ,
1374
1389
/// The channel value of the requested channel.
1375
1390
funding_satoshis : u64 ,
1376
- /// Our starting balance in the channel if the request is accepted, in milli-satoshi.
1377
- push_msat : u64 ,
1391
+ /// If `channel_negotiation_type` is `InboundChannelFunds::DualFunded`, this indicates that the peer wishes to
1392
+ /// open a dual-funded channel. Otherwise, this field will be `InboundChannelFunds::PushMsats`,
1393
+ /// indicating the `push_msats` value our peer is pushing to us for a non-dual-funded channel.
1394
+ channel_negotiation_type : InboundChannelFunds ,
1378
1395
/// The features that this channel will operate with. If you reject the channel, a
1379
1396
/// well-behaved counterparty may automatically re-attempt the channel with a new set of
1380
1397
/// feature flags.
0 commit comments