diff options
author | Andrew Chow <github@achow101.com> | 2023-05-01 09:03:37 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2023-05-01 09:10:11 -0400 |
commit | 0eae93e65ffb5fa5274b6a4b9b53ab79b99dfc10 (patch) | |
tree | 2398eea77b96d388efb8e2fb9dd33426a420b3dd /test | |
parent | 3497df4c759afcdf32dff1680c4e8bc48f9e7caa (diff) | |
parent | b922f6b5262884f42d7483f1e9af35650bdb53a7 (diff) |
Merge bitcoin/bitcoin#26780: rpc: simplify scan blocks
b922f6b5262884f42d7483f1e9af35650bdb53a7 rpc: scanblocks, add "completed" flag to the result obj (furszy)
ce50acc54fa313a92d48ed03e46ce8aabcf267e5 rpc: scanblocks, do not traverse the whole chain block by block (furszy)
Pull request description:
Coming from https://github.com/bitcoin/bitcoin/pull/23549#pullrequestreview-1105712566
The current `scanblocks` flow walks-through every block in the active chain
until hits the chain tip or processes 10k blocks, then calls `lookupFilterRange`
function to obtain all filters from that particular range.
This is only done to obtain the heights range to look up the block
filters. Which is unneeded.
As `scanblocks` only lookup block filters in the active chain, we can
directly calculate the lookup range heights, by using the chain tip,
without requiring to traverse the chain block by block.
ACKs for top commit:
achow101:
ACK b922f6b5262884f42d7483f1e9af35650bdb53a7
TheCharlatan:
ACK b922f6b5262884f42d7483f1e9af35650bdb53a7
Tree-SHA512: 0587e6d9cf87a59184adb2dbc26a4e2bce3a16233594c6c330f69feb49bf7dc63fdacf44fc20308e93441159ebc604c63eb7de19204d3e745a2ff16004892b45
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/rpc_scanblocks.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/functional/rpc_scanblocks.py b/test/functional/rpc_scanblocks.py index 9354709dfb..8b4aebc77a 100755 --- a/test/functional/rpc_scanblocks.py +++ b/test/functional/rpc_scanblocks.py @@ -49,6 +49,7 @@ class ScanblocksTest(BitcoinTestFramework): assert blockhash in out['relevant_blocks'] assert_equal(height, out['to_height']) assert_equal(0, out['from_height']) + assert_equal(True, out['completed']) # mine another block blockhash_new = self.generate(node, 1)[0] |