Skip to content

Commit 0f8cc71

Browse files
committed
f s/acceptor_funds/channel_negotiation_type & fix its docs
1 parent c2686af commit 0f8cc71

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
@@ -7049,7 +7049,7 @@ where
70497049
temporary_channel_id: msg.common_fields.temporary_channel_id.clone(),
70507050
counterparty_node_id: counterparty_node_id.clone(),
70517051
funding_satoshis: msg.common_fields.funding_satoshis,
7052-
acceptor_funds: InboundChannelFunds::PushMsat(msg.push_msat),
7052+
channel_negotiation_type: InboundChannelFunds::PushMsat(msg.push_msat),
70537053
channel_type: msg.common_fields.channel_type.clone().unwrap(),
70547054
}, None));
70557055
peer_state.inbound_channel_request_by_id.insert(temporary_channel_id, InboundChannelRequest {
@@ -7100,7 +7100,7 @@ where
71007100
temporary_channel_id: msg.common_fields.temporary_channel_id.clone(),
71017101
counterparty_node_id: counterparty_node_id.clone(),
71027102
funding_satoshis: msg.common_fields.funding_satoshis,
7103-
acceptor_funds: InboundChannelFunds::DualFunded,
7103+
channel_negotiation_type: InboundChannelFunds::DualFunded,
71047104
channel_type: msg.common_fields.channel_type.clone().unwrap(),
71057105
}, None));
71067106
peer_state.inbound_channel_request_by_id.insert(temporary_channel_id, InboundChannelRequest {

0 commit comments

Comments
 (0)