diff options
author | TheCharlatan <seb.kung@gmail.com> | 2023-07-13 21:17:45 +0200 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2023-08-01 22:14:15 +0200 |
commit | afc534df9adbf5599b286b5dc3531a4b9ac2d056 (patch) | |
tree | 6a4c255643b3dfe01d641dc2a7776564b84af531 /src/dbwrapper.h | |
parent | 42a9110899a9020417f0397456168aea6ac6ade9 (diff) | |
download | bitcoin-afc534df9adbf5599b286b5dc3531a4b9ac2d056.tar.xz |
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.
Diffstat (limited to 'src/dbwrapper.h')
-rw-r--r-- | src/dbwrapper.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/dbwrapper.h b/src/dbwrapper.h index 4ae2106211..478b73d56f 100644 --- a/src/dbwrapper.h +++ b/src/dbwrapper.h @@ -21,6 +21,7 @@ #include <leveldb/slice.h> #include <leveldb/status.h> #include <leveldb/write_batch.h> +#include <optional> #include <stdexcept> #include <string> #include <vector> @@ -64,10 +65,6 @@ public: class CDBWrapper; -namespace dbwrapper { - using leveldb::DestroyDB; -} - /** These should be considered an implementation detail of the specific database. */ namespace dbwrapper_private { @@ -82,7 +79,9 @@ void HandleError(const leveldb::Status& status); */ const std::vector<unsigned char>& GetObfuscateKey(const CDBWrapper &w); -}; +}; // namespace dbwrapper_private + +bool DestroyDB(const std::string& path_str); /** Batch of changes queued to be written to a CDBWrapper */ class CDBBatch |