diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2014-07-12 19:42:06 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2014-07-12 19:44:19 +0200 |
commit | 0f2f2b38d024342dfd9a4758dd5801e73c59f426 (patch) | |
tree | 48fbf1ff34795cbda4c952626d511a2fbe286aa0 | |
parent | d3165ed35adde59bdfbe72928b51a039202fa21e (diff) | |
parent | cd01a5e18507c09eb6bbf159418e29c28fd3cadb (diff) |
Merge pull request #4177
cd01a5e Enable paranoid corruption checks in LevelDB >= 1.16 (Pieter Wuille)
-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; } |