Update bitcoin-cli and gui debug console so that RPC calls that accept a block hash to reference a block will also accept a block by height prefixed by @
, or @best
to reference the tip. The clients will just make an RPC call to getblockhash
or getbestblockhash
to replace the argument with the hash before making the requested RPC call.
Affected RPCs:
- getblockheader
- getblock
- preciousblock
- invalidateblock
- getchaintxstats
- getblockfilter
- getrawtransaction
- gettxoutproof
The RPC calls waitforblock, and reconsiderblock are unaffected because specifying a blockhash already in the main chain for those calls is not useful, and getblockstats is unaffected because it already accepts a height.