Allow minting paid quotes after expiry - #1122
Draft
Egge21M wants to merge 1 commit into
Draft
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1122 +/- ##
=======================================
Coverage 74.43% 74.44%
=======================================
Files 113 113
Lines 12753 12748 -5
=======================================
- Hits 9493 9490 -3
+ Misses 3260 3258 -2 ☔ View full report in Codecov by Harness. |
callebtc
reviewed
Aug 16, 2026
Comment on lines
+600
to
+605
| if quote.state != MintQuoteState.paid: | ||
| raise QuoteNotPaidError() | ||
|
|
||
| # Quote expiry limits payment, not issuance of already-paid value. | ||
|
|
||
| # Check amount balance |
Collaborator
There was a problem hiding this comment.
this change isn't needed
callebtc
reviewed
Aug 16, 2026
Comment on lines
+514
to
+520
| if quote.state != MintQuoteState.paid: | ||
| raise QuoteNotPaidError() | ||
|
|
||
| # Quote expiry limits when the payment request can be paid. Once payment is | ||
| # confirmed, the quote remains mintable until its value has been issued. | ||
|
|
||
| previous_state = quote.state |
Collaborator
There was a problem hiding this comment.
this change isn't needed
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Root cause
Nutshell records a mint quote as paid when its Lightning backend reports the invoice settled, but
mintandmint_batchindependently rejected that paid quote once its expiry timestamp passed. This could leave a successfully paid quote permanently unmintable if the wallet did not request signatures before expiry.Quote expiry limits when the payment request can be paid. Once payment is confirmed, the paid value should remain mintable until it has been issued.
Impact
Wallets can recover ecash from paid quotes after expiry, including through the batch endpoint. Unpaid quotes remain unmintable, and the existing state transitions continue to prevent duplicate issuance.
Validation
pytest tests/mint/test_mint.py tests/mint/test_mint_batch.py -q— 37 passedruff check cashu/mint/ledger.py tests/mint/test_mint.py tests/mint/test_mint_batch.py