* Fix SQLite race condition
Bug: https://github.com/crodas/cdk/actions/runs/15732950296/job/44339804072#step:5:1853
Reason: When melting in parallel, many update the melt status and attempt to
add proofs and they fail when adding the proof and the rollback code kicks in.
The loser process removes all the proofs, and the winner process has no proof
later on.
Fix: Modify `update_melt_quote_state` requirements and implementation to allow
only one winner.
This will be solved by design with a transaction writer trait
* Remove `melt_request`
Fixes#809
* Remove `get_melt_request` from db trait
Bug: https://github.com/crodas/cdk/actions/runs/15732950296/job/44339804072#step:5:1853
Reason: When melting in parallel, many update the melt status and attempt to
add proofs and they fail when adding the proof and the rollback code kicks in.
The loser process removes all the proofs, and the winner process has no proof
later on.
Fix: Modify `update_melt_quote_state` requirements and implementation to allow
only one winner.
This will be solved by design with a transaction writer trait
Bug: https://github.com/cashubtc/cdk/actions/runs/15683152414/job/44190084378?pr=822#step:5:19212
Reason: a race condition between removing proofs while melting and the quote states being updated.
Solution:
1. Error on duplicate proofs
2. Read quote when updating to avoid race conditions and rollbacks
Real solution: A transaction trait in the storage layer. That is coming next
* Migrate from `sqlx` to rusqlite
1. Add rusqlite with rusqlite with a working thread
2. Add wallet without a thread (synchronous)
3. Add custom migration
Co-authored-by: thesimplekid <tsk@thesimplekid.com>
* feat(cli): enhance check-pending to reclaim proofs
The check-pending command now directly attempts to reclaim proofs that
are no longer pending, replacing the previous check-only behavior.
Changes:
- Replace check_all_pending_proofs with reclaim_unspent functionality
- Add more detailed feedback about pending proof status
- Update command description to reflect new reclaim behavior
- Improve error handling and status reporting
This change makes the command more useful by actively reclaiming
proofs rather than just checking their status.
* refactor: remove CheckSpendable command and check_spent module
The CheckSpendable command and its associated check_spent.rs module have been
removed as their functionality is redundant with the CheckPending command.
* refactor: add getters to Secret and SecretData
* refactor: use new getters for Secret and SecretData in wallet receive
* refactor: using SecretData constructor
---------
Co-authored-by: thesimplekid <tsk@thesimplekid.com>