Skip to content

Commit 9a6398d

Browse files
committed
Change return value of claim_funds to ignore duplicate claims
While we should never reach `ClaimFundsFromHop::DuplicateClaim` in most cases, if we do, it likely indicates the HTLC was timed out some time ago and is no longer available to be claimed. Thus, it does not make sense to imply that we `claimed_any_htlcs`.
1 parent 1f95b3e commit 9a6398d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2806,7 +2806,13 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
28062806
} else { errs.push((pk, err)); }
28072807
},
28082808
ClaimFundsFromHop::PrevHopForceClosed => unreachable!("We already checked for channel existence, we can't fail here!"),
2809-
_ => claimed_any_htlcs = true,
2809+
ClaimFundsFromHop::DuplicateClaim => {
2810+
// While we should never get here in most cases, if we do, it likely
2811+
// indicates that the HTLC was timed out some time ago and is no longer
2812+
// available to be claimed. Thus, it does not make sense to set
2813+
// `claimed_any_htlcs`.
2814+
},
2815+
ClaimFundsFromHop::Success(_) => claimed_any_htlcs = true,
28102816
}
28112817
}
28122818
}

0 commit comments

Comments
 (0)