Refactor leveldbwrapper

Was "Add chainstate obfuscation to avoid spurious antivirus detection"

Zcash: Extracted the refactor, omitting the chainstate obfuscation.
This commit is contained in:
James O'Beirne
2015-09-07 15:22:23 -07:00
committed by Jack Grigg
parent 3055fd5508
commit 0d81464be7
5 changed files with 74 additions and 14 deletions

View File

@@ -86,6 +86,12 @@ private:
leveldb::DB* pdb;
public:
/**
* @param[in] path Location in the filesystem where leveldb data will be stored.
* @param[in] nCacheSize Configures various leveldb cache settings.
* @param[in] fMemory If true, use leveldb's memory environment.
* @param[in] fWipe If true, remove all existing data.
*/
CLevelDBWrapper(const boost::filesystem::path& path, size_t nCacheSize, bool fMemory = false, bool fWipe = false);
~CLevelDBWrapper();
@@ -168,6 +174,13 @@ public:
{
return pdb->NewIterator(iteroptions);
}
/**
* Return true if the database managed by this class contains no entries.
*/
bool IsEmpty();
};
#endif // BITCOIN_LEVELDBWRAPPER_H