Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 757 Lines • ▼ Show 20 Lines | private: | ||||
* transactions without relying on Chain interface beyond asynchronous | * transactions without relying on Chain interface beyond asynchronous | ||||
* updates. For safety, we initialize it to -1. Height is a pointer on | * updates. For safety, we initialize it to -1. Height is a pointer on | ||||
* node's tip and doesn't imply that the wallet has scanned sequentially all | * node's tip and doesn't imply that the wallet has scanned sequentially all | ||||
* blocks up to this one. | * blocks up to this one. | ||||
*/ | */ | ||||
int m_last_block_processed_height GUARDED_BY(cs_wallet) = -1; | int m_last_block_processed_height GUARDED_BY(cs_wallet) = -1; | ||||
public: | public: | ||||
const CChainParams &chainParams; | |||||
/* | /* | ||||
* Main wallet lock. | * Main wallet lock. | ||||
* This lock protects all the fields added by CWallet. | * This lock protects all the fields added by CWallet. | ||||
*/ | */ | ||||
mutable RecursiveMutex cs_wallet; | mutable RecursiveMutex cs_wallet; | ||||
/** | /** | ||||
* Get database handle used by this wallet. Ideally this function would not | * Get database handle used by this wallet. Ideally this function would not | ||||
Show All 21 Lines | public: | ||||
*/ | */ | ||||
const std::string &GetName() const { return m_location.GetName(); } | const std::string &GetName() const { return m_location.GetName(); } | ||||
typedef std::map<unsigned int, CMasterKey> MasterKeyMap; | typedef std::map<unsigned int, CMasterKey> MasterKeyMap; | ||||
MasterKeyMap mapMasterKeys; | MasterKeyMap mapMasterKeys; | ||||
unsigned int nMasterKeyMaxID = 0; | unsigned int nMasterKeyMaxID = 0; | ||||
/** Construct wallet with specified name and database implementation. */ | /** Construct wallet with specified name and database implementation. */ | ||||
CWallet(const CChainParams &chainParamsIn, interfaces::Chain *chain, | CWallet(interfaces::Chain *chain, const WalletLocation &location, | ||||
const WalletLocation &location, | |||||
std::unique_ptr<WalletDatabase> _database) | std::unique_ptr<WalletDatabase> _database) | ||||
: m_chain(chain), m_location(location), database(std::move(_database)), | : m_chain(chain), m_location(location), database(std::move(_database)) { | ||||
chainParams(chainParamsIn) {} | } | ||||
~CWallet() { | ~CWallet() { | ||||
// Should not have slots connected at this point. | // Should not have slots connected at this point. | ||||
assert(NotifyUnload.empty()); | assert(NotifyUnload.empty()); | ||||
} | } | ||||
bool IsCrypted() const; | bool IsCrypted() const; | ||||
bool IsLocked() const override; | bool IsLocked() const override; | ||||
Show All 21 Lines | public: | ||||
std::unique_ptr<interfaces::Handler> m_chain_notifications_handler; | std::unique_ptr<interfaces::Handler> m_chain_notifications_handler; | ||||
/** Interface for accessing chain state. */ | /** Interface for accessing chain state. */ | ||||
interfaces::Chain &chain() const { | interfaces::Chain &chain() const { | ||||
assert(m_chain); | assert(m_chain); | ||||
return *m_chain; | return *m_chain; | ||||
} | } | ||||
const CChainParams &chainParams() const; | |||||
const CWalletTx *GetWalletTx(const TxId &txid) const; | const CWalletTx *GetWalletTx(const TxId &txid) const; | ||||
//! check whether we are allowed to upgrade (or already support) to the | //! check whether we are allowed to upgrade (or already support) to the | ||||
//! named feature | //! named feature | ||||
bool CanSupportFeature(enum WalletFeature wf) const override | bool CanSupportFeature(enum WalletFeature wf) const override | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { | ||||
AssertLockHeld(cs_wallet); | AssertLockHeld(cs_wallet); | ||||
return nWalletMaxVersion >= wf; | return nWalletMaxVersion >= wf; | ||||
▲ Show 20 Lines • Show All 592 Lines • Show Last 20 Lines |