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

This commit is contained in:
Harris
2019-12-06 21:47:55 +01:00
parent cb11324a63
commit 034561f9cd
3 changed files with 9 additions and 8 deletions

View File

@@ -4,6 +4,7 @@
#include <mutex>
#include <sstream>
#include <set>
#include <blockfilter.h>
#include <crypto/siphash.h>
@@ -221,15 +222,14 @@ bool BlockFilterTypeByName(const std::string& name, BlockFilterType& filter_type
return false;
}
const std::vector<BlockFilterType>& AllBlockFilterTypes()
const std::set<BlockFilterType>& AllBlockFilterTypes()
{
static std::vector<BlockFilterType> types;
static std::set<BlockFilterType> types;
static std::once_flag flag;
std::call_once(flag, []() {
types.reserve(g_filter_types.size());
for (auto entry : g_filter_types) {
types.push_back(entry.first);
types.insert(entry.first);
}
});