refactor: Wrap DestroyDB in dbwrapper helper

Wrap leveldb::DestroyDB in a helper function without exposing
leveldb-specifics.

Also, add missing optional include.

The context of this commit is an effort to decouple the dbwrapper header
file from leveldb includes. To this end, the includes are moved to the
dbwrapper implementation file. This is done as part of the kernel
project to reduce the number of required includes for users of the
kernel.
This commit is contained in:
TheCharlatan
2023-07-13 21:17:45 +02:00
parent 42a9110899
commit afc534df9a
3 changed files with 10 additions and 6 deletions

View File

@@ -27,6 +27,11 @@
#include <memory>
#include <optional>
bool DestroyDB(const std::string& path_str)
{
return leveldb::DestroyDB(path_str, {}).ok();
}
class CBitcoinLevelDBLogger : public leveldb::Logger {
public:
// This code is adapted from posix_logger.h, which is why it is using vsprintf.