aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-07-01 14:56:19 +0200
committerMacroFake <falke.marco@gmail.com>2022-07-01 14:56:23 +0200
commit53b1a2426c58f709b5cc0281ef67c0d29fc78a93 (patch)
tree797174a4366b130f5165ff9ef77bdcfa50861be8 /contrib
parentca08e00a1b1e8c04b5a83e3f95b7ca14c35ae23e (diff)
parent27c8056885b05bd25f540dbf6ede89230d43c7b9 (diff)
downloadbitcoin-53b1a2426c58f709b5cc0281ef67c0d29fc78a93.tar.xz
Merge bitcoin/bitcoin#25471: rpc: Disallow gettxoutsetinfo queries for a specific block with `use_index=false`
27c8056885b05bd25f540dbf6ede89230d43c7b9 rpc: Disallow gettxoutsetinfo queries for a specific block with use_index=false (Martin Zumsande) Pull request description: In the `gettxoutsetinfo` RPC, if we set `use_index` to false but specify `hash_or_height`, we currently hit a nonfatal error, e.g. `gettxoutsetinfo "muhash" "1" "false"` results in: ``` Internal bug detected: "!pindex || pindex->GetBlockHash() == view->GetBestBlock()" rpc/blockchain.cpp:836 (GetUTXOStats) ``` The failing check was added in [#24410](https://github.com/bitcoin/bitcoin/pull/24410/commits/664a14ba7ccb40aa82d35a59831acd35db1897a6), but the previous behavior, returning the specified height together with data corresponding to the tip's height, was very confusing too in my opinion. Fix this by disallowing the interaction of `use_index=false` and `hash_or_height` and add a RPC help example with `-named` because users might ask themselves how to use the `use_index` flag witout hitting an error. An alternative way would be to allow the interaction if the specified `hash_or_height` happens to correspond to the tip (which should then also be applied to the `HASH_SERIALIZED` check before). If reviewers would prefer that, please say so. ACKs for top commit: fjahr: utACK 27c8056885b05bd25f540dbf6ede89230d43c7b9 shaavan: ACK 27c8056885b05bd25f540dbf6ede89230d43c7b9 Tree-SHA512: 1d81c34eaa48c86134a2cf7193246d5de6bfd819d413c3b3fae9cb9290e0297a336111eeaecede2f0f020b0f9a181d240de0da4493e1b387fe63b8189154442b
Diffstat (limited to 'contrib')
0 files changed, 0 insertions, 0 deletions