MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / GetOptions

Function GetOptions

src/leveldbwrapper.cpp:30–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30static leveldb::Options GetOptions(size_t nCacheSize)
31{
32 leveldb::Options options;
33 options.block_cache = leveldb::NewLRUCache(nCacheSize / 2);
34 options.write_buffer_size = nCacheSize / 4; // up to two write buffers may be held in memory simultaneously
35 options.filter_policy = leveldb::NewBloomFilterPolicy(10);
36 options.compression = leveldb::kNoCompression;
37 options.max_open_files = 64;
38 if (leveldb::kMajorVersion > 1 || (leveldb::kMajorVersion == 1 && leveldb::kMinorVersion >= 16)) {
39 // LevelDB versions before 1.16 consider short writes to be corruption. Only trigger error
40 // on corruption in later versions.
41 options.paranoid_checks = true;
42 }
43 return options;
44}
45
46CLevelDBWrapper::CLevelDBWrapper(const boost::filesystem::path& path, size_t nCacheSize, bool &isObfuscated, bool fMemory, bool fWipe)
47{

Callers 1

CLevelDBWrapperMethod · 0.85

Calls 2

NewLRUCacheFunction · 0.85
NewBloomFilterPolicyFunction · 0.85

Tested by

no test coverage detected