Skip to content

Commit 83a121e

Browse files
committed
f s/acceptor_funds/channel_negotiation_type & fix its docs
1 parent 5a2263b commit 83a121e

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

lightning/src/events/mod.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ pub enum InboundChannelFunds {
546546
/// For a non-dual-funded channel, the `push_msat` value from the channel initiator to us.
547547
PushMsat(u64),
548548
/// Indicates the open request is for a dual funded channel.
549+
///
550+
/// Note that these channels do not support starting with initial funds pushed from the counterparty,
551+
// who is the channel opener in this case.
549552
DualFunded,
550553
}
551554

@@ -1154,9 +1157,9 @@ pub enum Event {
11541157
},
11551158
/// Indicates a request to open a new channel by a peer.
11561159
///
1157-
/// If `acceptor_funds` is `InboundChannelFunds::DualFunded`, this indicates that the peer wishes to
1158-
/// open a dual-funded channel. Otherwise, `acceptor_funds` will be `InboundChannelFunds::PushMsats`,
1159-
/// indicating the `push_msats` value for a non-dual-funded channel.
1160+
/// If `channel_negotiation_type` is `InboundChannelFunds::DualFunded`, this indicates that the peer wishes to
1161+
/// open a dual-funded channel. Otherwise, this field will be `InboundChannelFunds::PushMsats`,
1162+
/// indicating the `push_msats` value our peer is pushing to us for a non-dual-funded channel.
11601163
///
11611164
/// To accept the request (and in the case of a dual-funded channel, not contribute funds),
11621165
/// call [`ChannelManager::accept_inbound_channel`].
@@ -1191,8 +1194,10 @@ pub enum Event {
11911194
counterparty_node_id: PublicKey,
11921195
/// The channel value of the requested channel.
11931196
funding_satoshis: u64,
1194-
/// Our starting balance in the channel if the request is accepted, in milli-satoshi.
1195-
acceptor_funds: InboundChannelFunds,
1197+
/// If `channel_negotiation_type` is `InboundChannelFunds::DualFunded`, this indicates that the peer wishes to
1198+
/// open a dual-funded channel. Otherwise, this field will be `InboundChannelFunds::PushMsats`,
1199+
/// indicating the `push_msats` value our peer is pushing to us for a non-dual-funded channel.
1200+
channel_negotiation_type: InboundChannelFunds,
11961201
/// The features that this channel will operate with. If you reject the channel, a
11971202
/// well-behaved counterparty may automatically re-attempt the channel with a new set of
11981203
/// feature flags.

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7272,7 +7272,7 @@ where
72727272
temporary_channel_id: msg.common_fields.temporary_channel_id.clone(),
72737273
counterparty_node_id: counterparty_node_id.clone(),
72747274
funding_satoshis: msg.common_fields.funding_satoshis,
7275-
acceptor_funds: InboundChannelFunds::PushMsat(msg.push_msat),
7275+
channel_negotiation_type: InboundChannelFunds::PushMsat(msg.push_msat),
72767276
channel_type: msg.common_fields.channel_type.clone().unwrap(),
72777277
}, None));
72787278
peer_state.inbound_channel_request_by_id.insert(temporary_channel_id, InboundChannelRequest {
@@ -7323,7 +7323,7 @@ where
73237323
temporary_channel_id: msg.common_fields.temporary_channel_id.clone(),
73247324
counterparty_node_id: counterparty_node_id.clone(),
73257325
funding_satoshis: msg.common_fields.funding_satoshis,
7326-
acceptor_funds: InboundChannelFunds::DualFunded,
7326+
channel_negotiation_type: InboundChannelFunds::DualFunded,
73277327
channel_type: msg.common_fields.channel_type.clone().unwrap(),
73287328
}, None));
73297329
peer_state.inbound_channel_request_by_id.insert(temporary_channel_id, InboundChannelRequest {

0 commit comments

Comments
 (0)