Page MenuHomePhabricator

cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice
ClosedPublic

Authored by PiRK on Nov 9 2020, 10:39.

Details

Summary

If blockfilterindex=basic is specified in bitcoin.conf and again on the command line, bitcoind -chain=regtest -blockfilterindex=basic, bitcoind crashes.
This commit fixes it by replacing BlockFilterType-vector with a set of the same type to make sure that only unique filter types get inserted.

This is a backport of Core PR17687

Test Plan

After adding blockfilterindex=basic to bitcoin.conf, run:
src/bitcoind -chain=regtest -blockfilterindex=basic

Alternatively, run src/bitcoind --blockfilterindex=basic --blockfilterindex=basic

Diff Detail

Event Timeline

PiRK requested review of this revision.Nov 9 2020, 10:39
majcosta requested changes to this revision.Nov 9 2020, 10:47
majcosta added a subscriber: majcosta.

PR17687*

This revision now requires changes to proceed.Nov 9 2020, 10:47
src/blockfilter.cpp
14

this is redundant since it's included in the header file

remove redundant import and fix PR number in the revision

This revision is now accepted and ready to land.Nov 9 2020, 11:34