Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
void FlushWallets(); | void FlushWallets(); | ||||
//! Stop all wallets. Wallets will be flushed first. | //! Stop all wallets. Wallets will be flushed first. | ||||
void StopWallets(); | void StopWallets(); | ||||
//! Close all wallets. | //! Close all wallets. | ||||
void UnloadWallets(); | void UnloadWallets(); | ||||
//! Explicitly unload and delete the wallet. | |||||
// Blocks the current thread after signaling the unload intent so that all | |||||
// wallet clients release the wallet. | |||||
// Note that, when blocking is not required, the wallet is implicitly unloaded | |||||
// by the shared pointer deleter. | |||||
void UnloadWallet(std::shared_ptr<CWallet> &&wallet); | |||||
bool AddWallet(const std::shared_ptr<CWallet> &wallet); | bool AddWallet(const std::shared_ptr<CWallet> &wallet); | ||||
bool RemoveWallet(const std::shared_ptr<CWallet> &wallet); | bool RemoveWallet(const std::shared_ptr<CWallet> &wallet); | ||||
bool HasWallets(); | bool HasWallets(); | ||||
std::vector<std::shared_ptr<CWallet>> GetWallets(); | std::vector<std::shared_ptr<CWallet>> GetWallets(); | ||||
std::shared_ptr<CWallet> GetWallet(const std::string &name); | std::shared_ptr<CWallet> GetWallet(const std::string &name); | ||||
//! Default for -keypool | //! Default for -keypool | ||||
static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000; | static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000; | ||||
▲ Show 20 Lines • Show All 866 Lines • ▼ Show 20 Lines | public: | ||||
/** Construct wallet with specified name and database implementation. */ | /** Construct wallet with specified name and database implementation. */ | ||||
CWallet(const CChainParams &chainParamsIn, interfaces::Chain &chain, | CWallet(const CChainParams &chainParamsIn, interfaces::Chain &chain, | ||||
const WalletLocation &location, | const WalletLocation &location, | ||||
std::unique_ptr<WalletDatabase> databaseIn) | std::unique_ptr<WalletDatabase> databaseIn) | ||||
: m_chain(chain), m_location(location), database(std::move(databaseIn)), | : m_chain(chain), m_location(location), database(std::move(databaseIn)), | ||||
chainParams(chainParamsIn) {} | chainParams(chainParamsIn) {} | ||||
~CWallet() { | ~CWallet() { | ||||
// Should not have slots connected at this point. | |||||
assert(NotifyUnload.empty()); | |||||
delete encrypted_batch; | delete encrypted_batch; | ||||
encrypted_batch = nullptr; | encrypted_batch = nullptr; | ||||
} | } | ||||
std::map<TxId, CWalletTx> mapWallet GUARDED_BY(cs_wallet); | std::map<TxId, CWalletTx> mapWallet GUARDED_BY(cs_wallet); | ||||
std::list<CAccountingEntry> laccentries; | std::list<CAccountingEntry> laccentries; | ||||
typedef std::pair<CWalletTx *, CAccountingEntry *> TxPair; | typedef std::pair<CWalletTx *, CAccountingEntry *> TxPair; | ||||
▲ Show 20 Lines • Show All 667 Lines • Show Last 20 Lines |