Currently, after starting a scan with scanblocks
the user must wait until the scan is complete to see the associated/relevant block hashes.
This updates the scanblocks status
result object to provide the relevant_blocks
found so far.
This enables earlier subsequent lookup within matching blocks (e.g. to run getdescriptoractivity
in PR #30708)
Below is an example tested on signet by starting and obtaining status of a scan for an address that has received many coinbase outputs (so there are matches over many blocks, showing the increase in relevant_blocks
results in scanblocks status
over the life of the scan). Also tested on mainnet (see #30713#pullrequestreview-2296520203).
0src/bitcoin-cli -signet scanblocks start '["addr(tb1qsygnet2jdqm8n2p7wmmklp9yel3k7agpnycv4f)"]'
0src/bitcoin-cli -signet scanblocks status
1{
2 "progress": 14,
3 "current_height": 30002,
4 "relevant_blocks": [
5 "0000012aee246273622a8fb3546454a1d6c11cb468dfb1cd536a3058b0590cba",
6 "0000002e043f797a967fca25c18fd2b0f66ddce76b443e540327d2e19928d0aa",
7...
8 "000000f7626bb9f7917f48d0c63a9c30a4692232e5cd96366192a62c7d1a89a4",
9 "000000db94d6817657bd9184ad5f6232981cfe60177b7395485260a339b32571"
10 ]
11}
or (to show snapshots over time)
0for i in `seq 1 20`; do sleep 1; src/bitcoin-cli -signet scanblocks status > test$i.txt; done
-deprecatedrpc
seems like overkill for the addition of a key (not a data type change). Release notes have been added (affecting user interface).
If testing, be sure to enable the block filter index feature (e.g. adding blockfilterindex=1
to bitcoin.conf), and allow time for the index to build:
02024-09-11T12:17:49Z Config file arg: signet="1"
12024-09-11T12:17:49Z Config file arg: [signet] blockfilterindex="1"
22024-09-11T12:17:51Z Syncing basic block filter index with block chain from height 0
3...
42024-09-11T12:19:41Z basic block filter index is enabled at height 212758
52024-09-11T12:19:41Z basic block filter index thread exit