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
docs: Update the explainer text for the listunspent RPC #22525
Conversation
bitcoin-cli listunspent
bitcoin-cli listunspent
src/wallet/rpcwallet.cpp
Outdated
@@ -2882,7 +2882,7 @@ static RPCHelpMan listunspent() | |||
{RPCResult::Type::NUM, "confirmations", "The number of confirmations"}, | |||
{RPCResult::Type::STR_HEX, "redeemScript", "The redeemScript if scriptPubKey is P2SH"}, | |||
{RPCResult::Type::STR, "witnessScript", "witnessScript if the scriptPubKey is P2WSH or P2SH-P2WSH"}, | |||
{RPCResult::Type::BOOL, "spendable", "Whether we have the private keys to spend this output"}, | |||
{RPCResult::Type::BOOL, "spendable", "Whether we have the private keys to spend this output. Native descriptor wallets will always return true irregardless of whether the wallet holds private keys for the output."}, |
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.
{RPCResult::Type::BOOL, "spendable", "Whether we have the private keys to spend this output. Native descriptor wallets will always return true irregardless of whether the wallet holds private keys for the output."}, | |
{RPCResult::Type::BOOL, "spendable", "Whether we have the private keys to spend this output. Native descriptor wallets will always return true regardless of the wallet having private keys for the output."}, |
Replaced 'irregardless' with 'regardless' because it looks weird and people have different opinions about its grammar: https://english.stackexchange.com/questions/1259/irregardless-vs-irrespective
Removed 'whether' from 'regardless of whether' and people have different opinions about it: https://english.stackexchange.com/questions/107183/is-regardless-of-whether-or-not-proper-grammar
Can also squash commits: https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits |
Done. |
Ah sorry I misread that. Will make the change. |
Native descriptor wallets always consider outputs to be spendable. This should be made clear as it is an important distinction. Update src/wallet/rpcwallet.cpp Better grammar. Co-authored-by: Jon Atack <jon@atack.com>
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.
ACK 332192c
Looks good to me 🥃
This change is conceptually correct. This is the current behavior.
bitcoin-cli listunspent
maybe as an alternative, this could be written something like this:
Because it seems like this field only does something useful for legacy wallets (and will probably be deprecated once they are) |
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.
Thanks for your first PR!
The message should have a line break after each chunk of 80(?) characters. See this one for example.
Small nit, I would prefer the added message to be:
Native descriptor wallets will always return true.
versus:
Native descriptor wallets will always return true regardless of the wallet having private keys for the output.
The first one seems just as informative and more terse, since by definition, descriptor wallets don't have the keys. But maybe it's just personal preference.
Feel free to mark my comments as resolved as you wish.
Hmm, that's weird. Some messages truncate at 80 or 100, but some go beyond 100. Perhaps a change was made specifically to this line and the width was ignored. Maybe another reviewer knows what the correct width is? Does it not matter now? |
I agree its neater and more terse but it could be misinterpreted that all native descriptor wallets hold private keys if the help text only states |
I feel like it would be better to explain what the consequences of something being spendable is rather than when the wallet would mark an UTXO as spendable. Spendable really means that the wallet will consider the UTXO for spending who performing coin selection and Even in legacy wallets, it is possible to create a case where you should be able to spend a UTXO because private keys are available, but the UTXO is marked as not spendable. |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
I agree the more accurate the text the better. My PR certainly makes an improvement on the existing text which is down right misleading. I do not have the understanding of the underlying functionality to add anything more useful here, if you have a suggestion I am all ears. |
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
Closing for now. Let us know if it should be reopened. |
Users may find it confusing to see that their utxo is labelled as
spendable
when they know for certain their wallet does not hold private keys.This is a minor documentation fix for
bitcoin-cli listunspent
to clarify that native descriptor wallets always consider utxos to bespendable
.Fixes #22518.