diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2014-05-12 12:24:22 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2014-05-12 12:52:39 +0200 |
commit | cd01a5e18507c09eb6bbf159418e29c28fd3cadb (patch) | |
tree | 69c26b6a5823f1f79664f7781678cfc66653236a | |
parent | 029f4904d17cd4eb5df18f965d05c9a0113794b1 (diff) |
Enable paranoid corruption checks in LevelDB >= 1.16
-rw-r--r-- | src/leveldbwrapper.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/leveldbwrapper.cpp b/src/leveldbwrapper.cpp index 5b4a9c147b..9e849696a8 100644 --- a/src/leveldbwrapper.cpp +++ b/src/leveldbwrapper.cpp @@ -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; } |