cashubtc / cdk

Cashu Development Kit
MIT License
87 stars 45 forks source link

Wallet melt should not over pay risking ecash stuck in pending. #465

Open thesimplekid opened 1 week ago

thesimplekid commented 1 week ago

When melting the wallet can over pay the melt quote and have the change returned once the payment is complete. However in an error cash this can lead to ecash being stuck in a pending state. The wallet should select proofs and swap before a melt if it does not have proofs equal to the melt quote. Swapping before increases fees and requires an extra operation but is preferable to risking stuck ecash.

@davidcaseria just tagging you for tracking as we've talked about this before, but don't think we've fixed it.