Skip to content

Commit d2554a8

Browse files
committed
fix Set new channel reserve values based on new channel value (v2)
1 parent 2f9a0c1 commit d2554a8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lightning/src/ln/channel.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -9103,12 +9103,17 @@ impl<SP: Deref> FundedChannel<SP> where
91039103
_ => todo!()
91049104
}
91059105

9106+
// New reserve values are based on the new channel value, and v2-specific
9107+
let counterparty_selected_channel_reserve_satoshis = Some(get_v2_channel_reserve_satoshis(
9108+
post_channel_value, self.context.counterparty_dust_limit_satoshis));
9109+
let holder_selected_channel_reserve_satoshis = get_v2_channel_reserve_satoshis(
9110+
post_channel_value, MIN_CHAN_DUST_LIMIT_SATOSHIS);
91069111
let pending_funding = FundingScope {
91079112
channel_transaction_parameters: post_channel_transaction_parameters,
91089113
value_to_self_msat: post_value_to_self_msat,
91099114
funding_transaction: None,
9110-
counterparty_selected_channel_reserve_satoshis: self.funding.counterparty_selected_channel_reserve_satoshis, // TODO check
9111-
holder_selected_channel_reserve_satoshis: self.funding.holder_selected_channel_reserve_satoshis, // TODO check
9115+
counterparty_selected_channel_reserve_satoshis,
9116+
holder_selected_channel_reserve_satoshis,
91129117
#[cfg(debug_assertions)]
91139118
holder_max_commitment_tx_output: Mutex::new((post_value_to_self_msat, (post_channel_value * 1000).saturating_sub(post_value_to_self_msat))),
91149119
#[cfg(debug_assertions)]

0 commit comments

Comments
 (0)