Skip to content

Commit 8780c76

Browse files
laanwjcodablock
authored andcommitted
Merge bitcoin#10985: Add undocumented -forcecompactdb to force LevelDB compactions
8842d1a Add undocumented -forcecompactdb to force LevelDB compactions (Pieter Wuille) Pull request description: Tree-SHA512: de91f3f574f75248fa6e5091089c840957fae5a972ebcd2b89493f7d777d4658560a6f5a3b43ab0c9b2c333ad98f9f185ae224c9caffc1a5e8df369cc414f123
1 parent 4102211 commit 8780c76

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/dbwrapper.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ CDBWrapper::CDBWrapper(const boost::filesystem::path& path, size_t nCacheSize, b
115115
dbwrapper_private::HandleError(status);
116116
LogPrintf("Opened LevelDB successfully\n");
117117

118+
if (GetBoolArg("-forcecompactdb", false)) {
119+
LogPrintf("Starting database compaction of %s\n", path.string());
120+
pdb->CompactRange(nullptr, nullptr);
121+
LogPrintf("Finished database compaction of %s\n", path.string());
122+
}
123+
118124
// The base-case obfuscation key, which is a noop.
119125
obfuscate_key = std::vector<unsigned char>(OBFUSCATE_KEY_NUM_BYTES, '\000');
120126

0 commit comments

Comments
 (0)