mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
wallet: bdb: move BerkeleyDatabase constructor to cpp file
Else some compilers/stdlibs may not be able to construct std::unique_ptr<Db> without Db defined.
This commit is contained in:
parent
b3582baa3a
commit
004b184b02
@ -296,6 +296,13 @@ static Span<const std::byte> SpanFromDbt(const SafeDbt& dbt)
|
||||
return {reinterpret_cast<const std::byte*>(dbt.get_data()), dbt.get_size()};
|
||||
}
|
||||
|
||||
BerkeleyDatabase::BerkeleyDatabase(std::shared_ptr<BerkeleyEnvironment> env, fs::path filename, const DatabaseOptions& options) :
|
||||
WalletDatabase(), env(std::move(env)), m_filename(std::move(filename)), m_max_log_mb(options.max_log_mb)
|
||||
{
|
||||
auto inserted = this->env->m_databases.emplace(m_filename, std::ref(*this));
|
||||
assert(inserted.second);
|
||||
}
|
||||
|
||||
bool BerkeleyDatabase::Verify(bilingual_str& errorStr)
|
||||
{
|
||||
fs::path walletDir = env->Directory();
|
||||
|
@ -84,12 +84,7 @@ public:
|
||||
BerkeleyDatabase() = delete;
|
||||
|
||||
/** Create DB handle to real database */
|
||||
BerkeleyDatabase(std::shared_ptr<BerkeleyEnvironment> env, fs::path filename, const DatabaseOptions& options) :
|
||||
WalletDatabase(), env(std::move(env)), m_filename(std::move(filename)), m_max_log_mb(options.max_log_mb)
|
||||
{
|
||||
auto inserted = this->env->m_databases.emplace(m_filename, std::ref(*this));
|
||||
assert(inserted.second);
|
||||
}
|
||||
BerkeleyDatabase(std::shared_ptr<BerkeleyEnvironment> env, fs::path filename, const DatabaseOptions& options);
|
||||
|
||||
~BerkeleyDatabase() override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user