Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
dbwrapper.cpp
Go to the documentation of this file.
79 options.write_buffer_size = nCacheSize / 4; // up to two write buffers may be held in memory simultaneously
84 if (leveldb::kMajorVersion > 1 || (leveldb::kMajorVersion == 1 && leveldb::kMinorVersion >= 16)) {
92 CDBWrapper::CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory, bool fWipe, bool obfuscate)
These should be considered an implementation detail of the specific database.
Definition: dbwrapper.cpp:196
CDBWrapper(const fs::path &path, size_t nCacheSize, bool fMemory=false, bool fWipe=false, bool obfuscate=false)
Definition: dbwrapper.cpp:92
Definition: dbwrapper.h:197
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
Definition: utilstrencodings.h:100
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
Definition: util.cpp:824
void HandleError(const leveldb::Status &status)
Handle database error by throwing dbwrapper_error exception.
Definition: dbwrapper.cpp:198
Definition: util.h:130
std::vector< unsigned char > CreateObfuscateKey() const
Returns a string (consisting of 8 random bytes) suitable for use as an obfuscating XOR key...
Definition: dbwrapper.cpp:176
leveldb::ReadOptions readoptions
options used when reading from the database
Definition: dbwrapper.h:208
void Logv(const char *format, va_list ap) override
Definition: dbwrapper.cpp:21
leveldb::WriteOptions syncoptions
options used when sync writing to the database
Definition: dbwrapper.h:217
Definition: dbwrapper.cpp:17
leveldb::ReadOptions iteroptions
options used when iterating over values of the database
Definition: dbwrapper.h:211
bool TryCreateDirectories(const fs::path &p)
Ignores exceptions thrown by Boost's create_directories if the requested directory exists...
Definition: util.cpp:1085
void format(std::ostream &out, const char *fmt, const Args &... args)
Format list of arguments to the stream according to given format string.
Definition: tinyformat.h:967
Definition: dbwrapper.h:24
leveldb::WriteOptions writeoptions
options used when writing to the database
Definition: dbwrapper.h:214
bool IsEmpty()
Return true if the database managed by this class contains no entries.
Definition: dbwrapper.cpp:184
const std::vector< unsigned char > & GetObfuscateKey(const CDBWrapper &w)
Work around circular dependency, as well as for testing in dbwrapper_tests.
Definition: dbwrapper.cpp:212
static const unsigned int OBFUSCATE_KEY_NUM_BYTES
the length of the obfuscate key in number of bytes
Definition: dbwrapper.h:229
bool Write(const K &key, const V &value, bool fSync=false)
Definition: dbwrapper.h:298
leveldb::Env * penv
custom environment this database is using (may be nullptr in case of default environment) ...
Definition: dbwrapper.h:202
static const std::string OBFUSCATE_KEY_KEY
the key under which the obfuscation key is stored
Definition: dbwrapper.h:226
void GetRandBytes(unsigned char *buf, int num)
Functions to gather random data via the OpenSSL PRNG.
Definition: random.cpp:273
bool WriteBatch(CDBBatch &batch, bool fSync=false)
Definition: dbwrapper.cpp:157
std::vector< unsigned char > obfuscate_key
a key used for optional XOR-obfuscation of the database
Definition: dbwrapper.h:223