Skip to content

Commit d9d0b50

Browse files
committed
f Improve legibility somewhat with a new variable, as arik suggested
1 parent ce0c534 commit d9d0b50

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3563,10 +3563,11 @@ impl<Signer: Sign> Channel<Signer> {
35633563
/// back.
35643564
pub fn update_best_block(&mut self, height: u32, highest_header_time: u32) -> Result<(Option<msgs::FundingLocked>, Vec<(HTLCSource, PaymentHash)>), msgs::ErrorMessage> {
35653565
let mut timed_out_htlcs = Vec::new();
3566+
let unforwarded_htlc_cltv_limit = height + HTLC_FAIL_BACK_BUFFER;
35663567
self.holding_cell_htlc_updates.retain(|htlc_update| {
35673568
match htlc_update {
35683569
&HTLCUpdateAwaitingACK::AddHTLC { ref payment_hash, ref source, ref cltv_expiry, .. } => {
3569-
if *cltv_expiry <= height + HTLC_FAIL_BACK_BUFFER {
3570+
if *cltv_expiry <= unforwarded_htlc_cltv_limit {
35703571
timed_out_htlcs.push((source.clone(), payment_hash.clone()));
35713572
false
35723573
} else { true }

0 commit comments

Comments
 (0)