Skip to content

Commit 76c31ba

Browse files
committed
f simplify logic
1 parent 531f65e commit 76c31ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12967,17 +12967,17 @@ 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().all(|bal| {
12970+
if inbound_edge_balances.iter().any(|bal| {
1297112971
match bal {
1297212972
Balance::ClaimableOnChannelClose { .. } => {
1297312973
// The channel is still open, assume we can still
1297412974
// claim against it
12975-
false
12975+
true
1297612976
},
1297712977
Balance::MaybePreimageClaimableHTLC { payment_hash, .. } => {
12978-
*payment_hash != htlc_payment_hash
12978+
*payment_hash == htlc_payment_hash
1297912979
},
12980-
_ => true,
12980+
_ => false,
1298112981
}
1298212982
}) {
1298312983
return None;

0 commit comments

Comments
 (0)