Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.cpp
Show First 20 Lines • Show All 1,119 Lines • ▼ Show 20 Lines | bool WalletBatch::TxnAbort() { | ||||
return m_batch->TxnAbort(); | return m_batch->TxnAbort(); | ||||
} | } | ||||
bool IsWalletLoaded(const fs::path &wallet_path) { | bool IsWalletLoaded(const fs::path &wallet_path) { | ||||
return IsBDBWalletLoaded(wallet_path); | return IsBDBWalletLoaded(wallet_path); | ||||
} | } | ||||
/** Return object for accessing database at specified path. */ | /** Return object for accessing database at specified path. */ | ||||
std::unique_ptr<BerkeleyDatabase> CreateWalletDatabase(const fs::path &path) { | std::unique_ptr<WalletDatabase> CreateWalletDatabase(const fs::path &path) { | ||||
std::string filename; | std::string filename; | ||||
return std::make_unique<BerkeleyDatabase>(GetWalletEnv(path, filename), | return std::make_unique<BerkeleyDatabase>(GetWalletEnv(path, filename), | ||||
std::move(filename)); | std::move(filename)); | ||||
} | } | ||||
/** | /** | ||||
* Return object for accessing dummy database with no read/write capabilities. | * Return object for accessing dummy database with no read/write capabilities. | ||||
*/ | */ | ||||
std::unique_ptr<BerkeleyDatabase> CreateDummyWalletDatabase() { | std::unique_ptr<WalletDatabase> CreateDummyWalletDatabase() { | ||||
return std::make_unique<BerkeleyDatabase>(); | return std::make_unique<BerkeleyDatabase>(); | ||||
} | } | ||||
/** Return object for accessing temporary in-memory database. */ | /** Return object for accessing temporary in-memory database. */ | ||||
std::unique_ptr<BerkeleyDatabase> CreateMockWalletDatabase() { | std::unique_ptr<WalletDatabase> CreateMockWalletDatabase() { | ||||
return std::make_unique<BerkeleyDatabase>( | return std::make_unique<BerkeleyDatabase>( | ||||
std::make_shared<BerkeleyEnvironment>(), ""); | std::make_shared<BerkeleyEnvironment>(), ""); | ||||
} | } |