-
Notifications
You must be signed in to change notification settings - Fork 102
Check for spendable UTXOs before payjoin operations #1071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -473,6 +473,12 @@ impl App { | |
| let wallet = self.wallet(); | ||
| let candidate_inputs = wallet.list_unspent()?; | ||
|
|
||
| if candidate_inputs.is_empty() { | ||
| return Err(anyhow::anyhow!( | ||
| "No spendable UTXOs available in wallet. Cannot contribute inputs to payjoin." | ||
| )); | ||
| } | ||
|
Comment on lines
+476
to
+480
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check if fine as the internal error is opaque and this is checked in the input selection logic https://github.com/payjoin/rust-payjoin/blob/3f057e130d45c423a22c5e41007529cc0ee6894f/payjoin/src/core/receive/common/mod.rs#L273C51-L273C87 But ideally the receiver should fallback here instead. And we propogate the internally error somehow so we don't have a duplicate check |
||
|
|
||
| let selected_input = proposal.try_preserving_privacy(candidate_inputs)?; | ||
| let proposal = | ||
| proposal.contribute_inputs(vec![selected_input])?.commit_inputs().save(persister)?; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as v2 applies here