Do not fail to load ChannelManager
when we see claiming payments
#3772
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we begin claiming a payment, we move the tracking of it from
claimable_payments
toclaiming_payments
. This ensures we only ever have one payment which is in the process of being claimed with a given payment hash at a time and lets us keep track of when all parts have been claimed with theirChannelMonitor
s.However, on startup, we check that failing to move a payment from
claimable_payments
toclaiming_payments
we check that it is not present inclaiming_payments
. This is fine if the payment doesn't exist, but if the payment has already started being claimed, this will fail and we'll refuse to deserialize theChannelManager
(with adebug_assert
failure in debug mode).Here we resolve this by checking if a payment is already being claimed before we attempt to initiate claiming and skip the failing check in that case.