fn htlc_completion_error(
err: &NodeError,
payment_hash: &str,
) -> LightningRpcErrorExpand description
Classifies an ldk-node claim or fail error for the gateway’s completion
retry loop.
claim_for_hash and fail_for_hash fail deterministically for an unknown
payment hash, a preimage that does not hash to it, or an amount below the
registered one. Retrying cannot change any of those, so they are reported
as LightningRpcError::HtlcCompletionRejected and the completion state
machine records the outcome instead of retrying forever. Everything else,
today only a failed store write, is treated as transient: the incoming
contract is already funded by the time this runs, so an error this list
does not know must keep retrying rather than be recorded as final.