HomePhabricator

[backport#16383 1/3] rpcwallet: default include_watchonly to true for watchonly…

Description

[backport#16383 1/3] rpcwallet: default include_watchonly to true for 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 <jb55@jb55.com>

https://github.com/bitcoin/bitcoin/pull/16383/commits/a50d9e6c0b8e8144d3deec58ec2e3449ba081151


Partial backport of Core PR16383

Test Plan:

ninja check check-functional

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7121

Details

Provenance
William Casarin <jb55@jb55.com>Authored on Jul 13 2019, 15:34
majcostaCommitted on Aug 7 2020, 18:31
majcostaPushed on Aug 7 2020, 18:32
Reviewer
Restricted Project
Differential Revision
D7121: [backport#16383 1/3] rpcwallet: default include_watchonly to true for watchonly wallets
Parents
rABC86511aa32764: Bump version to 0.22.0
Branches
Unknown
Tags
Unknown