Skip to content

Commit d099894

Browse files
author
MarcoFalke
committed
Merge #20969: test: check that getblockfilter RPC fails without block filter index
233a886 test: check that getblockfilter RPC fails without block filter index (Sebastian Falbesoner) Pull request description: If a node was started without compact block filter index (parameter `--blockfilterindex=0`), the `getblockfilter` RPC call should fail. ACKs for top commit: MarcoFalke: review ACK 233a886 Tree-SHA512: c8824373fad7d1de2dcb43c1d9541d736b478235be243080d2b7479c2588eac0e5722337ec1307394b331e0002fbcabb368e4955c2dc98dd5fce76d8c089e8a1
2 parents 47b99ab + 233a886 commit d099894

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/functional/rpc_getblockfilter.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,11 @@ def run_test(self):
5454
genesis_hash = self.nodes[0].getblockhash(0)
5555
assert_raises_rpc_error(-5, "Unknown filtertype", self.nodes[0].getblockfilter, genesis_hash, "unknown")
5656

57+
# Test getblockfilter fails on node without compact block filter index
58+
self.restart_node(0, extra_args=["-blockfilterindex=0"])
59+
for filter_type in FILTER_TYPES:
60+
assert_raises_rpc_error(-1, "Index is not enabled for filtertype {}".format(filter_type),
61+
self.nodes[0].getblockfilter, genesis_hash, filter_type)
62+
5763
if __name__ == '__main__':
5864
GetBlockFilterTest().main()

0 commit comments

Comments
 (0)