mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-04 06:12:07 +01:00
cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice
Github-Pull: #17687
Rebased-From: 034561f9cd
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <set>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <attributes.h>
|
||||
@@ -865,7 +866,7 @@ int nUserMaxConnections;
|
||||
int nFD;
|
||||
ServiceFlags nLocalServices = ServiceFlags(NODE_NETWORK | NODE_NETWORK_LIMITED);
|
||||
int64_t peer_connect_timeout;
|
||||
std::vector<BlockFilterType> g_enabled_filter_types;
|
||||
std::set<BlockFilterType> g_enabled_filter_types;
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -953,13 +954,12 @@ bool AppInitParameterInteraction()
|
||||
g_enabled_filter_types = AllBlockFilterTypes();
|
||||
} else if (blockfilterindex_value != "0") {
|
||||
const std::vector<std::string> names = gArgs.GetArgs("-blockfilterindex");
|
||||
g_enabled_filter_types.reserve(names.size());
|
||||
for (const auto& name : names) {
|
||||
BlockFilterType filter_type;
|
||||
if (!BlockFilterTypeByName(name, filter_type)) {
|
||||
return InitError(strprintf(_("Unknown -blockfilterindex value %s.").translated, name));
|
||||
}
|
||||
g_enabled_filter_types.push_back(filter_type);
|
||||
g_enabled_filter_types.insert(filter_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user