Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.h
Show First 20 Lines • Show All 295 Lines • ▼ Show 20 Lines | |||||
//! Callback for filtering key types to deserialize in ReadKeyValue | //! Callback for filtering key types to deserialize in ReadKeyValue | ||||
using KeyFilterFn = std::function<bool(const std::string &)>; | using KeyFilterFn = std::function<bool(const std::string &)>; | ||||
//! Unserialize a given Key-Value pair and load it into the wallet | //! Unserialize a given Key-Value pair and load it into the wallet | ||||
bool ReadKeyValue(CWallet *pwallet, CDataStream &ssKey, CDataStream &ssValue, | bool ReadKeyValue(CWallet *pwallet, CDataStream &ssKey, CDataStream &ssValue, | ||||
std::string &strType, std::string &strErr, | std::string &strType, std::string &strErr, | ||||
const KeyFilterFn &filter_fn = nullptr); | const KeyFilterFn &filter_fn = nullptr); | ||||
/** Return whether a wallet database is currently loaded. */ | |||||
bool IsWalletLoaded(const fs::path &wallet_path); | |||||
/** Return object for accessing database at specified path. */ | /** Return object for accessing database at specified path. */ | ||||
std::unique_ptr<WalletDatabase> CreateWalletDatabase(const fs::path &path); | std::unique_ptr<WalletDatabase> CreateWalletDatabase(const fs::path &path); | ||||
/** | /** | ||||
* 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<WalletDatabase> CreateDummyWalletDatabase(); | std::unique_ptr<WalletDatabase> CreateDummyWalletDatabase(); | ||||
/** Return object for accessing temporary in-memory database. */ | /** Return object for accessing temporary in-memory database. */ | ||||
std::unique_ptr<WalletDatabase> CreateMockWalletDatabase(); | std::unique_ptr<WalletDatabase> CreateMockWalletDatabase(); | ||||
#endif // BITCOIN_WALLET_WALLETDB_H | #endif // BITCOIN_WALLET_WALLETDB_H |