rust-payjoin icon indicating copy to clipboard operation
rust-payjoin copied to clipboard

Check for spendable UTXOs before payjoin operations

Open 0xZaddyy opened this issue 4 months ago • 3 comments

This PR improves error handling when a wallet has no UTXOs. Previously, attempting to send or receive without UTXOs returned a generic Error: Obtained failure status(500): Internal Server Error. This change lets the code now performs UTXO checks and provides informative error messages for both send and receive operations. This makes failures more user-friendly and easier to debug. Closes #1070

Pull Request Checklist

Please confirm the following before requesting review:

0xZaddyy avatar Sep 15 '25 11:09 0xZaddyy

Pull Request Test Coverage Report for Build 17735121824

Details

  • 13 of 22 (59.09%) changed or added relevant lines in 4 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.1%) to 85.688%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin-cli/src/app/mod.rs 2 5 40.0%
payjoin-cli/src/app/v1.rs 2 8 25.0%
<!-- Total: 13 22
Files with Coverage Reduction New Missed Lines %
payjoin-cli/src/app/v2/mod.rs 3 79.07%
<!-- Total: 3
Totals Coverage Status
Change from base Build 17685450439: -0.1%
Covered Lines: 8065
Relevant Lines: 9412

💛 - Coveralls

coveralls avatar Sep 15 '25 11:09 coveralls

cACK

New validation and its use look correct to me. I had one suggestion for the error messages. Lastly, do you mind re-writing your commit message to include the rationale for the change. Not just what changes were made.

Great work 🔥

Thank you @arminsabouri i'll fix it now

0xZaddyy avatar Sep 15 '25 13:09 0xZaddyy

Is this actually a payjoin-cli issue or was our RPC client (ripped out in https://github.com/payjoin/rust-payjoin/pull/1063) just just not displaying the bitcoind error properly?

spacebear21 avatar Sep 15 '25 21:09 spacebear21