Page MenuHomePhabricator

[rpc] fix verbose argument for getblock in bitcoin-cli
ClosedPublic

Authored by Fabien on Fri, Jul 5, 15:43.

Details

Summary
Using the verbose option with getblock in bitcoin-cli has been broken
since #8704:

→ bitcoin-cli -named getblock
blockhash=0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206
verbose=true
error code: -1
error message:
JSON value is not a boolean as expected

→ bitcoin-cli -named getblock
blockhash=0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206
verbosity=true
{
  "hash": "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206",
...

In general, I think that adding aliases because some people find
argument names distasteful is a bad idea since it leads to subtle bugs
like this.

However, that functionality has already been merged in so I'm not going
to try to undo it. This is the simplest fix for restoring the previous
behavior.

Backport of core PR10747
https://github.com/bitcoin/bitcoin/pull/10747/files

Test Plan
bitcoin-cli -named getblock
blockhash=000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
verbose=true

Should return no error

Diff Detail

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