Skip to content

Commit ff85846

Browse files
committed
fixup: Make TxBuilder::get_next_commitment_stats fallible
1 parent 2cfe11d commit ff85846

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

lightning/src/ln/channel.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4292,18 +4292,20 @@ where
42924292
predicted_fee_sat: ret.commit_tx_fee_sat,
42934293
};
42944294
} else {
4295-
let predicted_stats = SpecTxBuilder {}.get_next_commitment_stats(
4296-
true,
4297-
funding.is_outbound(),
4298-
funding.get_value_satoshis(),
4299-
next_value_to_self_msat,
4300-
&next_commitment_htlcs,
4301-
0,
4302-
feerate_per_kw,
4303-
dust_exposure_limiting_feerate,
4304-
self.holder_dust_limit_satoshis,
4305-
funding.get_channel_type(),
4306-
)?;
4295+
let predicted_stats = SpecTxBuilder {}
4296+
.get_next_commitment_stats(
4297+
true,
4298+
funding.is_outbound(),
4299+
funding.get_value_satoshis(),
4300+
next_value_to_self_msat,
4301+
&next_commitment_htlcs,
4302+
0,
4303+
feerate_per_kw,
4304+
dust_exposure_limiting_feerate,
4305+
self.holder_dust_limit_satoshis,
4306+
funding.get_channel_type(),
4307+
)
4308+
.expect("Balance on local commitment after HTLCs and anchors exhausted");
43074309
*funding.next_local_fee.lock().unwrap() = PredictedNextFee {
43084310
predicted_feerate: feerate_per_kw,
43094311
predicted_nondust_htlc_count: predicted_stats.nondust_htlc_count,

0 commit comments

Comments
 (0)