Skip to content

Commit 7cf88e8

Browse files
committed
fixup: correct funder amount logging in new for inbound and outbound
1 parent 2d0fd42 commit 7cf88e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2779,7 +2779,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
27792779
remote_balance_before_fee_msat,
27802780
} = SpecTxBuilder {}.build_commitment_stats(false, open_channel_fields.commitment_feerate_sat_per_1000_weight, MIN_AFFORDABLE_HTLC_COUNT, value_to_self_msat, funders_amount_msat, &channel_type);
27812781
if remote_balance_before_fee_msat / 1000 < total_fee_sat {
2782-
return Err(ChannelError::close(format!("Funding amount ({} sats) can't even pay fee for initial commitment transaction fee of {} sats.", remote_balance_before_fee_msat / 1000, total_fee_sat)));
2782+
return Err(ChannelError::close(format!("Funding amount ({} sats) can't even pay fee for initial commitment transaction fee of {} sats.", funders_amount_msat / 1000, total_fee_sat)));
27832783
}
27842784

27852785
let to_remote_satoshis = remote_balance_before_fee_msat / 1000 - total_fee_sat;
@@ -3052,7 +3052,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
30523052
remote_balance_before_fee_msat: _,
30533053
} = SpecTxBuilder {}.build_commitment_stats(true, commitment_feerate, MIN_AFFORDABLE_HTLC_COUNT, value_to_self_msat, push_msat, &channel_type);
30543054
if local_balance_before_fee_msat / 1000 < total_fee_sat {
3055-
return Err(APIError::APIMisuseError{ err: format!("Funding amount ({}) can't even pay fee for initial commitment transaction fee of {}.", local_balance_before_fee_msat / 1000, total_fee_sat) });
3055+
return Err(APIError::APIMisuseError{ err: format!("Funding amount ({}) can't even pay fee for initial commitment transaction fee of {}.", value_to_self_msat / 1000, total_fee_sat) });
30563056
}
30573057

30583058
let mut secp_ctx = Secp256k1::new();

0 commit comments

Comments
 (0)