I run a node in pruned mode. I want to enable blockfilterindex. What I expected the node to do was:

  1. start downloading blocks from the very beginning;
  2. create the block filter as it goes through the blocks;
  3. only keep the last N MB of blocks stored.

What really happened was:

$ bitcoind -blockfilterindex -prune=550
Error: Prune mode is incompatible with -txindex.

I understand that it is not possible to enable block filtering without downloading all blocks, but why does it require storing all the blocks?

  • 1
    That error isn't for -blockfilterindex, it's for -txindex. Do you have txindex=1 in your bitcoin.conf file?
    – Andrew Chow
    Nov 22 '20 at 19:42
  • True! However, when I disabled txindex, I got Error: Prune mode is incompatible with -blockfilterindex. Nov 22 '20 at 20:16

The block filter index is build asynchronously from block downloading and validation. It is possible that the thread handing block storage and pruning could be enough ahead of the thread building the block filter index that it starts to delete blocks before the index thread processes them. This would be bad. So for the initial block filter index implementation, it was decided to simply disallow pruning when the block filter index is enabled. You can read some of the reasoning and discussion in the PR.

In theory it is possible to allow pruning with the block filter index. However it is more work to do this and at least for the initial implementation, the extra code wasn't worth it. PR authors often do this to keep the PR small enough to be reviewed. This functionality could be added in the future as it is part of the more general problem of how we should handle pruning with the wallet and with the txindex.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.