Browse Source

Merge pull request #4177

cd01a5e Enable paranoid corruption checks in LevelDB >= 1.16 (Pieter Wuille)
0.10
Pieter Wuille 11 years ago
parent
commit
0f2f2b38d0
No known key found for this signature in database
GPG Key ID: 8F653255C87992E0
  1. 5
      src/leveldbwrapper.cpp

5
src/leveldbwrapper.cpp

@ -32,6 +32,11 @@ static leveldb::Options GetOptions(size_t nCacheSize) {
options.filter_policy = leveldb::NewBloomFilterPolicy(10); options.filter_policy = leveldb::NewBloomFilterPolicy(10);
options.compression = leveldb::kNoCompression; options.compression = leveldb::kNoCompression;
options.max_open_files = 64; options.max_open_files = 64;
if (leveldb::kMajorVersion > 1 || (leveldb::kMajorVersion == 1 && leveldb::kMinorVersion >= 16)) {
// LevelDB versions before 1.16 consider short writes to be corruption. Only trigger error
// on corruption in later versions.
options.paranoid_checks = true;
}
return options; return options;
} }

Loading…
Cancel
Save