Skip to content

Commit c601e45

Browse files
committed
f use variables to clarify what we're calculating
1 parent d823c1d commit c601e45

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12967,19 +12967,20 @@ where
1296712967
// inbound edge of the payment's monitor has already claimed
1296812968
// the HTLC) we skip trying to replay the claim.
1296912969
let htlc_payment_hash: PaymentHash = payment_preimage.into();
12970-
if !inbound_edge_balances.iter().any(|bal| {
12971-
match bal {
12972-
Balance::ClaimableOnChannelClose { .. } => {
12973-
// The channel is still open, assume we can still
12974-
// claim against it
12975-
true
12976-
},
12977-
Balance::MaybePreimageClaimableHTLC { payment_hash, .. } => {
12978-
*payment_hash == htlc_payment_hash
12979-
},
12980-
_ => false,
12981-
}
12982-
}) {
12970+
let balance_could_incl_htlc = |bal| match bal {
12971+
Balance::ClaimableOnChannelClose { .. } => {
12972+
// The channel is still open, assume we can still
12973+
// claim against it
12974+
true
12975+
},
12976+
Balance::MaybePreimageClaimableHTLC { payment_hash, .. } => {
12977+
*payment_hash == htlc_payment_hash
12978+
},
12979+
_ => false,
12980+
};
12981+
let htlc_may_be_in_balances =
12982+
inbound_edge_balances.iter().any(balance_could_incl_htlc);
12983+
if !htlc_may_be_in_balances {
1298312984
return None;
1298412985
}
1298512986

0 commit comments

Comments
 (0)