When a melt operation is stuck in executing state and the quote expires on the mint, recoverExecutingOperation() fails permanently, leaving
proofs locked forever.
MeltBolt11Handler.recoverExecuting() calls checkMeltQuoteState() which throws MintOperationError(20007) when the quote has expired. This
error is unhandled — it propagates up to tryRecoverExecutingOperation() which swallows it with only a warning log. No proof restoration
occurs.
Since recoverPendingOperations() on app restart calls the same code path, the operation remains stuck across restarts indefinitely.
Reproduction
- prepareMeltBolt11() → executeMelt() → mint network error during execution
- State transitions to executing, tryRecoverExecutingOperation() fails (mint unreachable)
- Wait for quote to expire on mint
- Restart app → recoverPendingOperations() → recoverExecutingOperation()
- checkMeltQuoteState() throws MintOperationError(20007)
- Error swallowed, proofs remain locked in executing state permanently
Root cause
MeltBolt11Handler.recoverExecuting() (packages/core/infra/handlers/melt/MeltBolt11Handler.ts:576) only handles PAID/PENDING/UNPAID responses
from checkMeltQuoteState(). It does not catch MintOperationError for quote expiry.
Note: MintBolt11Handler.recoverExecuting() (packages/core/infra/handlers/mint/MintBolt11Handler.ts:131) already handles this case for mint
operations:
} else if (err.code === 20007) {
return {
status: 'TERMINAL',
error: Recovered: quote ${quoteId} expired while executing mint,
};
}
Expected fix
In MeltBolt11Handler.recoverExecuting(), catch MintOperationError(20007) and treat it as UNPAID — the quote expired means the LN payment was
never completed, so proofs can be safely restored.
Related
When a melt operation is stuck in executing state and the quote expires on the mint, recoverExecutingOperation() fails permanently, leaving
proofs locked forever.
MeltBolt11Handler.recoverExecuting() calls checkMeltQuoteState() which throws MintOperationError(20007) when the quote has expired. This
error is unhandled — it propagates up to tryRecoverExecutingOperation() which swallows it with only a warning log. No proof restoration
occurs.
Since recoverPendingOperations() on app restart calls the same code path, the operation remains stuck across restarts indefinitely.
Reproduction
Root cause
MeltBolt11Handler.recoverExecuting() (packages/core/infra/handlers/melt/MeltBolt11Handler.ts:576) only handles PAID/PENDING/UNPAID responses
from checkMeltQuoteState(). It does not catch MintOperationError for quote expiry.
Note: MintBolt11Handler.recoverExecuting() (packages/core/infra/handlers/mint/MintBolt11Handler.ts:131) already handles this case for mint
operations:
} else if (err.code === 20007) {
return {
status: 'TERMINAL',
error:
Recovered: quote ${quoteId} expired while executing mint,};
}
Expected fix
In MeltBolt11Handler.recoverExecuting(), catch MintOperationError(20007) and treat it as UNPAID — the quote expired means the LN payment was
never completed, so proofs can be safely restored.
Related