HomePhabricator

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

Description

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

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

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Subscribers: majcosta

Differential Revision: https://reviews.bitcoinabc.org/D8322

Details

Provenance
Harris <brakmic@gmail.com>Authored on Nov 9 2020, 12:03
PiRKCommitted on Nov 9 2020, 12:04
abc-botPushed on Nov 9 2020, 12:09
Reviewer
Restricted Project
Differential Revision
D8322: cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice
Parents
rABC75faf303172d: util: Update tinyformat to upstream
Branches
Unknown
Tags
Unknown