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).
build/src/bitcoin-cli -signet scanblocks start '["addr(tb1qsygnet2jdqm8n2p7wmmklp9yel3k7agpnycv4f)"]'
build/src/bitcoin-cli -signet scanblocks status
{
"progress": 14,
"current_height": 30002,
"relevant_blocks": [
"0000012aee246273622a8fb3546454a1d6c11cb468dfb1cd536a3058b0590cba",
"0000002e043f797a967fca25c18fd2b0f66ddce76b443e540327d2e19928d0aa",
...
"000000f7626bb9f7917f48d0c63a9c30a4692232e5cd96366192a62c7d1a89a4",
"000000db94d6817657bd9184ad5f6232981cfe60177b7395485260a339b32571"
]
}
or (to show snapshots over time)
for 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:
2024-09-11T12:17:49Z Config file arg: signet="1"
2024-09-11T12:17:49Z Config file arg: [signet] blockfilterindex="1"
2024-09-11T12:17:51Z Syncing basic block filter index with block chain from height 0
...
2024-09-11T12:19:41Z basic block filter index is enabled at height 212758
2024-09-11T12:19:41Z basic block filter index thread exit