Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 762 Lines • ▼ Show 20 Lines | private: | ||||
* private, but it is marked private anyway to encourage use of the other | * private, but it is marked private anyway to encourage use of the other | ||||
* AddWatchOnly which accepts a timestamp and sets nTimeFirstKey more | * AddWatchOnly which accepts a timestamp and sets nTimeFirstKey more | ||||
* intelligently for more efficient rescans. | * intelligently for more efficient rescans. | ||||
*/ | */ | ||||
bool AddWatchOnly(const CScript &dest) override | bool AddWatchOnly(const CScript &dest) override | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
/** Interface for accessing chain state. */ | /** Interface for accessing chain state. */ | ||||
interfaces::Chain &m_chain; | interfaces::Chain *m_chain; | ||||
/** | /** | ||||
* Wallet location which includes wallet name (see WalletLocation). | * Wallet location which includes wallet name (see WalletLocation). | ||||
*/ | */ | ||||
WalletLocation m_location; | WalletLocation m_location; | ||||
/** Internal database handle. */ | /** Internal database handle. */ | ||||
std::unique_ptr<WalletDatabase> database; | std::unique_ptr<WalletDatabase> database; | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | public: | ||||
// Map from Script ID to key metadata (for watch-only keys). | // Map from Script ID to key metadata (for watch-only keys). | ||||
std::map<CScriptID, CKeyMetadata> m_script_metadata GUARDED_BY(cs_wallet); | std::map<CScriptID, CKeyMetadata> m_script_metadata GUARDED_BY(cs_wallet); | ||||
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(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. | // Should not have slots connected at this point. | ||||
assert(NotifyUnload.empty()); | assert(NotifyUnload.empty()); | ||||
Show All 12 Lines | public: | ||||
std::map<CTxDestination, CAddressBookData> mapAddressBook; | std::map<CTxDestination, CAddressBookData> mapAddressBook; | ||||
std::set<COutPoint> setLockedCoins GUARDED_BY(cs_wallet); | std::set<COutPoint> setLockedCoins GUARDED_BY(cs_wallet); | ||||
/** Registered interfaces::Chain::Notifications handler. */ | /** Registered interfaces::Chain::Notifications handler. */ | ||||
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 { return m_chain; } | interfaces::Chain &chain() const { | ||||
assert(m_chain); | |||||
return *m_chain; | |||||
} | |||||
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 | bool CanSupportFeature(enum WalletFeature wf) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { | ||||
AssertLockHeld(cs_wallet); | AssertLockHeld(cs_wallet); | ||||
▲ Show 20 Lines • Show All 633 Lines • Show Last 20 Lines |