PR description:
Maintaining the blockfilterindexes in prune mode is possible and may lead to efficient p2p based rescans of wallets (restore backups, import/sweep keys) beyond the prune height (rescans not part of that PR).
This PR allows running the blockfilterindex(es) in conjunction with pruning.
- Bitcoind/Qt will shutdown during startup when missing block data has been detected ([re]enable -blockfilterindex when we already have pruned)
- manual block pruning is disabled during blockfilterindex sync
- auto-pruning is delayed during blockfilterindex sync
Allow blockfilter in conjunction with prune
https://github.com/bitcoin/bitcoin/pull/15946/commits/6abe9f5b11cd4a5ecb6caca8443fe2950a417842
index: Fix backwards search for bestblock
https://github.com/bitcoin/bitcoin/pull/23365/commits/698c524698c33595a4d555eaa9e21bc19b4d3e93
Avoid accessing nullpointer in BaseIndex::GetSummary()
https://github.com/bitcoin/bitcoin/pull/15946/commits/00d57ff76854938ead800767fb673a8af46eac8e
Avoid pruning below the blockfilterindex sync height
https://github.com/bitcoin/bitcoin/pull/15946/commits/5e112269c311a559bfded814d3c3c438349a1986
Add debug startup parameter -fastprune for more effective pruning tests
https://github.com/bitcoin/bitcoin/pull/15946/commits/00d57ff76854938ead800767fb673a8af46eac8e
Add functional test for blockfilterindex in prune-mode
https://github.com/bitcoin/bitcoin/pull/15946/commits/ab3a0a2fb915d8b8384c30a8b38b4b5cc35236fd
Fix several bugs in feature_blockfilterindex_prune.py
test: Intermittent issue in feature_blockfilterindex_prune
test: improve assertions in feature_blockfilterindex_prune.py
test: remove unneeded node from feature_blockfilterindex_prune.py
test: Add edge case of pruning up to index height
https://github.com/bitcoin/bitcoin/pull/23365/commits/9600ea01450b0d39be90eb2971c1ac5c9b69a66e
This is a backport of core#15946, core#21230, core#21252, core#21297 and core#23365
Backport notes:
- the test was buggy and ugly code after the first commit, so I had to squash all these commits to reach an acceptable quality.
- I had to use different numbers of blocks that are generated and pruned, because Bitcoin ABC can fit more blocks into each blk?????.dat file than core because in this test the witness data of the coinbase transaction makes core blocks larger. Comments were added to explain this where needed.
- I used the shortcut node = self.nodes[0] to make the code a bit more readable (shorter lines)