Skip to content

Commit 0f2f2b3

Browse files
committed
Merge pull request #4177
cd01a5e Enable paranoid corruption checks in LevelDB >= 1.16 (Pieter Wuille)
2 parents d3165ed + cd01a5e commit 0f2f2b3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/leveldbwrapper.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ static leveldb::Options GetOptions(size_t nCacheSize) {
3232
options.filter_policy = leveldb::NewBloomFilterPolicy(10);
3333
options.compression = leveldb::kNoCompression;
3434
options.max_open_files = 64;
35+
if (leveldb::kMajorVersion > 1 || (leveldb::kMajorVersion == 1 && leveldb::kMinorVersion >= 16)) {
36+
// LevelDB versions before 1.16 consider short writes to be corruption. Only trigger error
37+
// on corruption in later versions.
38+
options.paranoid_checks = true;
39+
}
3540
return options;
3641
}
3742

0 commit comments

Comments
 (0)