Skip to content

Commit 50f47ec

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 2024c5e commit 50f47ec

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lightning/src/ln/channelmanager.rs

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

0 commit comments

Comments
 (0)