mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-01 03:01:09 +02:00
rpc: Always throw in getblockstats if -txindex is required
Previously blocks with only the coinbase transaction didn't cause the RPC error even if the requested stats required -txindex and it wasn't enabled.
This commit is contained in:
@ -169,6 +169,8 @@ class GetblockstatsTest(BitcoinTestFramework):
|
||||
assert_raises_rpc_error(-8, 'Invalid selected statistic aaa%s' % inv_sel_stat,
|
||||
self.nodes[0].getblockstats, hash_or_height=1, stats=['minfee' , 'aaa%s' % inv_sel_stat])
|
||||
|
||||
assert_raises_rpc_error(-8, 'One or more of the selected stats requires -txindex enabled',
|
||||
self.nodes[1].getblockstats, hash_or_height=1)
|
||||
assert_raises_rpc_error(-8, 'One or more of the selected stats requires -txindex enabled',
|
||||
self.nodes[1].getblockstats, hash_or_height=self.start_height + self.max_stat_pos)
|
||||
|
||||
|
Reference in New Issue
Block a user