mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Move SafeDbt out of BerkeleyBatch
This commit is contained in:
parent
6061eb6564
commit
69efbc011b
2 changed files with 26 additions and 26 deletions
|
|
@ -220,17 +220,17 @@ BerkeleyEnvironment::BerkeleyEnvironment() : m_use_shared_memory(false)
|
|||
fMockDb = true;
|
||||
}
|
||||
|
||||
BerkeleyBatch::SafeDbt::SafeDbt()
|
||||
SafeDbt::SafeDbt()
|
||||
{
|
||||
m_dbt.set_flags(DB_DBT_MALLOC);
|
||||
}
|
||||
|
||||
BerkeleyBatch::SafeDbt::SafeDbt(void* data, size_t size)
|
||||
SafeDbt::SafeDbt(void* data, size_t size)
|
||||
: m_dbt(data, size)
|
||||
{
|
||||
}
|
||||
|
||||
BerkeleyBatch::SafeDbt::~SafeDbt()
|
||||
SafeDbt::~SafeDbt()
|
||||
{
|
||||
if (m_dbt.get_data() != nullptr) {
|
||||
// Clear memory, e.g. in case it was a private key
|
||||
|
|
@ -244,17 +244,17 @@ BerkeleyBatch::SafeDbt::~SafeDbt()
|
|||
}
|
||||
}
|
||||
|
||||
const void* BerkeleyBatch::SafeDbt::get_data() const
|
||||
const void* SafeDbt::get_data() const
|
||||
{
|
||||
return m_dbt.get_data();
|
||||
}
|
||||
|
||||
uint32_t BerkeleyBatch::SafeDbt::get_size() const
|
||||
uint32_t SafeDbt::get_size() const
|
||||
{
|
||||
return m_dbt.get_size();
|
||||
}
|
||||
|
||||
BerkeleyBatch::SafeDbt::operator Dbt*()
|
||||
SafeDbt::operator Dbt*()
|
||||
{
|
||||
return &m_dbt;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue