MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetOptions

Function GetOptions

src/dbwrapper.cpp:100–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100static leveldb::Options GetOptions(size_t nCacheSize)
101{
102 leveldb::Options options;
103 options.block_cache = leveldb::NewLRUCache(nCacheSize / 2);
104 options.write_buffer_size = nCacheSize / 4; // up to two write buffers may be held in memory simultaneously
105 options.filter_policy = leveldb::NewBloomFilterPolicy(10);
106 options.compression = leveldb::kNoCompression;
107 options.info_log = new CBitcoinLevelDBLogger();
108 if (leveldb::kMajorVersion > 1 || (leveldb::kMajorVersion == 1 && leveldb::kMinorVersion >= 16)) {
109 // LevelDB versions before 1.16 consider short writes to be corruption. Only trigger error
110 // on corruption in later versions.
111 options.paranoid_checks = true;
112 }
113 SetMaxOpenFiles(&options);
114 return options;
115}
116
117CDBWrapper::CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory, bool fWipe, bool obfuscate)
118 : m_name{fs::PathToString(path.stem())}

Callers 1

CDBWrapperMethod · 0.85

Calls 3

NewLRUCacheFunction · 0.85
NewBloomFilterPolicyFunction · 0.85
SetMaxOpenFilesFunction · 0.85

Tested by

no test coverage detected