mirror of
https://github.com/monero-project/monero.git
synced 2025-08-23 00:05:09 -04:00
unit_tests: add ringdb unit tests
This commit is contained in:
parent
90a16b119f
commit
6a61f520e2
4 changed files with 181 additions and 5 deletions
|
@ -190,7 +190,8 @@ namespace tools
|
|||
{
|
||||
|
||||
ringdb::ringdb(std::string filename, const std::string &genesis):
|
||||
filename(filename)
|
||||
filename(filename),
|
||||
env(NULL)
|
||||
{
|
||||
MDB_txn *txn;
|
||||
bool tx_active = false;
|
||||
|
@ -227,9 +228,18 @@ ringdb::ringdb(std::string filename, const std::string &genesis):
|
|||
|
||||
ringdb::~ringdb()
|
||||
{
|
||||
mdb_dbi_close(env, dbi_rings);
|
||||
mdb_dbi_close(env, dbi_blackballs);
|
||||
mdb_env_close(env);
|
||||
close();
|
||||
}
|
||||
|
||||
void ringdb::close()
|
||||
{
|
||||
if (env)
|
||||
{
|
||||
mdb_dbi_close(env, dbi_rings);
|
||||
mdb_dbi_close(env, dbi_blackballs);
|
||||
mdb_env_close(env);
|
||||
env = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool ringdb::add_rings(const crypto::chacha_key &chacha_key, const cryptonote::transaction_prefix &tx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue