Page MenuHomePhabricator

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

Authored by majcosta on Aug 4 2020, 12:36.



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 <>

Partial backport of Core PR16383

Test Plan
ninja check check-functional

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.