Changeset View
Changeset View
Standalone View
Standalone View
src/dbwrapper.cpp
Show All 26 Lines | if (leveldb::kMajorVersion > 1 || | ||||
(leveldb::kMajorVersion == 1 && leveldb::kMinorVersion >= 16)) { | (leveldb::kMajorVersion == 1 && leveldb::kMinorVersion >= 16)) { | ||||
// LevelDB versions before 1.16 consider short writes to be corruption. | // LevelDB versions before 1.16 consider short writes to be corruption. | ||||
// Only trigger error on corruption in later versions. | // Only trigger error on corruption in later versions. | ||||
options.paranoid_checks = true; | options.paranoid_checks = true; | ||||
} | } | ||||
return options; | return options; | ||||
} | } | ||||
CDBWrapper::CDBWrapper(const boost::filesystem::path &path, size_t nCacheSize, | CDBWrapper::CDBWrapper(const fs::path &path, size_t nCacheSize, bool fMemory, | ||||
bool fMemory, bool fWipe, bool obfuscate) { | bool fWipe, bool obfuscate) { | ||||
penv = nullptr; | penv = nullptr; | ||||
readoptions.verify_checksums = true; | readoptions.verify_checksums = true; | ||||
iteroptions.verify_checksums = true; | iteroptions.verify_checksums = true; | ||||
iteroptions.fill_cache = false; | iteroptions.fill_cache = false; | ||||
syncoptions.sync = true; | syncoptions.sync = true; | ||||
options = GetOptions(nCacheSize); | options = GetOptions(nCacheSize); | ||||
options.create_if_missing = true; | options.create_if_missing = true; | ||||
if (fMemory) { | if (fMemory) { | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |