]> Git Repo - VerusCoin.git/commitdiff
Enable paranoid corruption checks in LevelDB >= 1.16
authorPieter Wuille <[email protected]>
Mon, 12 May 2014 10:24:22 +0000 (12:24 +0200)
committerPieter Wuille <[email protected]>
Mon, 12 May 2014 10:52:39 +0000 (12:52 +0200)
src/leveldbwrapper.cpp

index 5b4a9c147b7e260754890312f93d396826eb1471..9e849696a8480988e160a4b3e075ac03a8fcbf2b 100644 (file)
@@ -32,6 +32,11 @@ static leveldb::Options GetOptions(size_t nCacheSize) {
     options.filter_policy = leveldb::NewBloomFilterPolicy(10);
     options.compression = leveldb::kNoCompression;
     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;
 }
 
This page took 0.025308 seconds and 4 git commands to generate.