aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpc_scanblocks.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/rpc_scanblocks.py')
-rwxr-xr-xtest/functional/rpc_scanblocks.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/functional/rpc_scanblocks.py b/test/functional/rpc_scanblocks.py
index 9a00518150..126e95362b 100755
--- a/test/functional/rpc_scanblocks.py
+++ b/test/functional/rpc_scanblocks.py
@@ -27,7 +27,6 @@ class ScanblocksTest(BitcoinTestFramework):
def run_test(self):
node = self.nodes[0]
wallet = MiniWallet(node)
- wallet.rescan_utxos()
# send 1.0, mempool only
_, spk_1, addr_1 = getnewdestination()
@@ -62,6 +61,12 @@ class ScanblocksTest(BitcoinTestFramework):
# make sure the blockhash is present when using the first mined block as start_height
assert blockhash in node.scanblocks(
"start", [f"addr({addr_1})"], height)['relevant_blocks']
+ for v in [False, True]:
+ assert blockhash in node.scanblocks(
+ action="start",
+ scanobjects=[f"addr({addr_1})"],
+ start_height=height,
+ options={"filter_false_positives": v})['relevant_blocks']
# also test the stop height
assert blockhash in node.scanblocks(
@@ -94,8 +99,11 @@ class ScanblocksTest(BitcoinTestFramework):
assert genesis_blockhash in node.scanblocks(
"start", [{"desc": f"raw({false_positive_spk.hex()})"}], 0, 0)['relevant_blocks']
- # TODO: after an "accurate" mode for scanblocks is implemented (e.g. PR #26325)
- # check here that it filters out the false-positive
+ # check that the filter_false_positives option works
+ assert genesis_blockhash in node.scanblocks(
+ "start", [{"desc": f"raw({genesis_coinbase_spk.hex()})"}], 0, 0, "basic", {"filter_false_positives": True})['relevant_blocks']
+ assert genesis_blockhash not in node.scanblocks(
+ "start", [{"desc": f"raw({false_positive_spk.hex()})"}], 0, 0, "basic", {"filter_false_positives": True})['relevant_blocks']
# test node with disabled blockfilterindex
assert_raises_rpc_error(-1, "Index is not enabled for filtertype basic",