-
Notifications
You must be signed in to change notification settings - Fork 38.7k
rpcwallet: default include_watchonly to true for watchonly wallets #16383
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
Conversation
maflcko
left a comment
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.
Would have to update the documentation as well for the "smart" default value.
5bd7c0c to
2370175
Compare
|
Concept ACK. I think having |
2370175 to
d60e77c
Compare
|
@MarcoFalke I'm a bit new, which docs specifically would need to be updated? |
- {"include_watchonly", RPCArg::Type::BOOL, /* default */ "false", "Whether to include watch-only addresses in balance calculation and details[]"},
+ {"include_watchonly", RPCArg::Type::BOOL, /* default */ ">>>>>>>>>>> update here<<<<<<<<", "Whether to include watch-only addresses in balance calculation and details[]"}, |
jonatack
left a comment
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.
Concept ACK. Will test when help docs are updated. Seems this change would merit test coverage?
9a33c13 to
3c145c3
Compare
|
@MarcoFalke I wasn't quite sure what to do for documenting the smart default, let me know if that looks ok |
|
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. |
3c145c3 to
cc0d834
Compare
promag
left a comment
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.
Concept ACK
Seems this change would merit test coverage?
Agree with @jonatack. Also add a minor release note?
|
Concept ACK, this definitely seems like the only sensible default to have in that case. |
|
concept ACK, needs tests(as others have said) |
|
One thing I missed was rpcs with the |
|
Concept ACK |
cc0d834 to
efbe2c9
Compare
The logic before would only include watchonly addresses if it was explicitly set in the rpc argument. This changes the logic like so: If the include_watchonly argument is missing, check the WALLET_FLAG_DISABLE_PRIVATE_KEYS flag to determine if we're working with a watchonly wallet. If so, default include_watchonly to true. If the include_watchonly argument is explicit set to false, we still disable them from the listing. Although this would always return nothing, it might be still useful in situations where you want to explicitly filter out watchonly addresses regardless of what wallet you are dealing with. Signed-off-by: William Casarin <[email protected]>
Signed-off-by: William Casarin <[email protected]>
4caca1d to
c7cbf29
Compare
|
Latest updates:
This is the first time I've done the last two things, so let me know if I did anything wrong. |
fanquake
left a comment
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 72eaab0 - I've looked over the changes, they make sense to me. Compiled and ran the tests etc.
Thanks to @kallewoof and @ajtowns (he said he sanity checked on his lunch break) for following up my review prod.
I know there are some nits here, however this has ACKs, and has been sitting for a while, so I'm going to merge it. The nits can be scooped up by someone in either a follow up PR, or a related change.
…nly wallets 72eaab0 tests: functional watch-only wallet tests (William Casarin) 72ffbdc doc: add release note for include_watchonly default changes (William Casarin) 003a3c7 rpcwallet: document include_watchonly default for watchonly wallets (William Casarin) a50d9e6 rpcwallet: default include_watchonly to true for watchonly wallets (William Casarin) Pull request description: Right now it's a bit annoying to deal with watchonly wallets, many rpc commands have an `include_watchonly` argument that needs to be explicitly set. Wallets created with `createwallet` can have a `disable_private_keys` parameter, for those wallets we already know that they are watchonly, so there's no reason to have to explicitly ask for it for every command. Instead we check this wallet flag when the `include_watchonly` parameter isn't set. ACKs for top commit: achow101: Code review ACK 72eaab0 Sjors: ACK 72eaab0 promag: ACK 72eaab0, code review only, didn't look closely to the test. kallewoof: ACK 72eaab0 fanquake: ACK 72eaab0 - I've looked over the changes, they make sense to me. Compiled and ran the tests etc. Tree-SHA512: d3646b55e97f386594d7efc994f0712f3888475c6a5dc7f131ac9f8c49bf5d4677182b88f42b34152abe1ad101ecadd152b4c20e9d3c1267190db36f77ab8bd7
… watchonly wallets 72eaab0 tests: functional watch-only wallet tests (William Casarin) 72ffbdc doc: add release note for include_watchonly default changes (William Casarin) 003a3c7 rpcwallet: document include_watchonly default for watchonly wallets (William Casarin) a50d9e6 rpcwallet: default include_watchonly to true for watchonly wallets (William Casarin) Pull request description: Right now it's a bit annoying to deal with watchonly wallets, many rpc commands have an `include_watchonly` argument that needs to be explicitly set. Wallets created with `createwallet` can have a `disable_private_keys` parameter, for those wallets we already know that they are watchonly, so there's no reason to have to explicitly ask for it for every command. Instead we check this wallet flag when the `include_watchonly` parameter isn't set. ACKs for top commit: achow101: Code review ACK 72eaab0 Sjors: ACK 72eaab0 promag: ACK 72eaab0, code review only, didn't look closely to the test. kallewoof: ACK 72eaab0 fanquake: ACK 72eaab0 - I've looked over the changes, they make sense to me. Compiled and ran the tests etc. Tree-SHA512: d3646b55e97f386594d7efc994f0712f3888475c6a5dc7f131ac9f8c49bf5d4677182b88f42b34152abe1ad101ecadd152b4c20e9d3c1267190db36f77ab8bd7
… watchonly wallets Summary: The logic before would only include watchonly addresses if it was explicitly set in the rpc argument. This changes the logic like so: If the include_watchonly argument is missing, check the WALLET_FLAG_DISABLE_PRIVATE_KEYS flag to determine if we're working with a watchonly wallet. If so, default include_watchonly to true. If the include_watchonly argument is explicit set to false, we still disable them from the listing. Although this would always return nothing, it might be still useful in situations where you want to explicitly filter out watchonly addresses regardless of what wallet you are dealing with. Signed-off-by: William Casarin <[email protected]> bitcoin/bitcoin@a50d9e6 --- Partial backport of Core [[bitcoin/bitcoin#16383 | PR16383]] Test Plan: ninja check check-functional Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D7121
…r watchonly wallets Summary: Signed-off-by: William Casarin <[email protected]> bitcoin/bitcoin@003a3c7 --- Depends on D7121 Partial backport of Core [[bitcoin/bitcoin#16383 | PR16383]] Test Plan: ninja Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D7122
Summary: These test the new watch-only defaults for rpcs with include_watchonly and includeWatching options. Signed-off-by: William Casarin <[email protected]> bitcoin/bitcoin@72eaab0 doc: add release note for include_watchonly default changes Signed-off-by: William Casarin <[email protected]> bitcoin/bitcoin@72ffbdc --- Depends on D7122 Concludes backport of Core [[bitcoin/bitcoin#16383 | PR16383]] Test Plan: ninja check check-functional Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Subscribers: deadalnix Differential Revision: https://reviews.bitcoinabc.org/D7123
Right now it's a bit annoying to deal with watchonly wallets, many rpc commands have an
include_watchonlyargument that needs to be explicitly set.Wallets created with
createwalletcan have adisable_private_keysparameter, for those wallets we already know that they are watchonly, so there's no reason to have to explicitly ask for it for every command. Instead we check this wallet flag when theinclude_watchonlyparameter isn't set.