diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-08-05 13:11:55 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-08-05 13:12:59 +0200 |
commit | d896d5cc427414ad9181e5bd76f8357da1cb4c68 (patch) | |
tree | a584aaeca5a4b298e3bd9e9dd47be1f120716454 /src | |
parent | e222618a32a16cf0efae392e6349c10c38e57db6 (diff) | |
parent | 8842d1a5d48bb6015030b12407ebd2060160c40f (diff) |
Merge #10985: Add undocumented -forcecompactdb to force LevelDB compactions
8842d1a Add undocumented -forcecompactdb to force LevelDB compactions (Pieter Wuille)
Pull request description:
Tree-SHA512: de91f3f574f75248fa6e5091089c840957fae5a972ebcd2b89493f7d777d4658560a6f5a3b43ab0c9b2c333ad98f9f185ae224c9caffc1a5e8df369cc414f123
Diffstat (limited to 'src')
-rw-r--r-- | src/dbwrapper.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp index ba9e21cc1f..3626e0177f 100644 --- a/src/dbwrapper.cpp +++ b/src/dbwrapper.cpp @@ -115,6 +115,12 @@ CDBWrapper::CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory, bo dbwrapper_private::HandleError(status); LogPrintf("Opened LevelDB successfully\n"); + if (GetBoolArg("-forcecompactdb", false)) { + LogPrintf("Starting database compaction of %s\n", path.string()); + pdb->CompactRange(nullptr, nullptr); + LogPrintf("Finished database compaction of %s\n", path.string()); + } + // The base-case obfuscation key, which is a noop. obfuscate_key = std::vector<unsigned char>(OBFUSCATE_KEY_NUM_BYTES, '\000'); |