Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 748 Lines • ▼ Show 20 Lines | std::string GetName() const { | ||||
return dbw->GetName(); | return dbw->GetName(); | ||||
} else { | } else { | ||||
return "dummy"; | return "dummy"; | ||||
} | } | ||||
} | } | ||||
void LoadKeyPool(int64_t nIndex, const CKeyPool &keypool); | void LoadKeyPool(int64_t nIndex, const CKeyPool &keypool); | ||||
// Map from Key ID (for regular keys) or Script ID (for watch-only keys) to | // Map from Key ID to key metadata. | ||||
// key metadata. | std::map<CKeyID, CKeyMetadata> mapKeyMetadata; | ||||
std::map<CTxDestination, CKeyMetadata> mapKeyMetadata; | |||||
// Map from Script ID to key metadata (for watch-only keys). | |||||
std::map<CScriptID, CKeyMetadata> m_script_metadata; | |||||
typedef std::map<unsigned int, CMasterKey> MasterKeyMap; | typedef std::map<unsigned int, CMasterKey> MasterKeyMap; | ||||
MasterKeyMap mapMasterKeys; | MasterKeyMap mapMasterKeys; | ||||
unsigned int nMasterKeyMaxID; | unsigned int nMasterKeyMaxID; | ||||
// Create wallet with dummy database handle | // Create wallet with dummy database handle | ||||
explicit CWallet(const CChainParams &chainParamsIn) | explicit CWallet(const CChainParams &chainParamsIn) | ||||
: dbw(new CWalletDBWrapper()), chainParams(chainParamsIn) { | : dbw(new CWalletDBWrapper()), chainParams(chainParamsIn) { | ||||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | public: | ||||
bool AddKeyPubKeyWithDB(CWalletDB &walletdb, const CKey &key, | bool AddKeyPubKeyWithDB(CWalletDB &walletdb, const CKey &key, | ||||
const CPubKey &pubkey); | const CPubKey &pubkey); | ||||
//! Adds a key to the store, without saving it to disk (used by LoadWallet) | //! Adds a key to the store, without saving it to disk (used by LoadWallet) | ||||
bool LoadKey(const CKey &key, const CPubKey &pubkey) { | bool LoadKey(const CKey &key, const CPubKey &pubkey) { | ||||
return CCryptoKeyStore::AddKeyPubKey(key, pubkey); | return CCryptoKeyStore::AddKeyPubKey(key, pubkey); | ||||
} | } | ||||
//! Load metadata (used by LoadWallet) | //! Load metadata (used by LoadWallet) | ||||
bool LoadKeyMetadata(const CTxDestination &pubKey, | bool LoadKeyMetadata(const CKeyID &keyID, const CKeyMetadata &metadata); | ||||
bool LoadScriptMetadata(const CScriptID &script_id, | |||||
const CKeyMetadata &metadata); | const CKeyMetadata &metadata); | ||||
bool LoadMinVersion(int nVersion) { | bool LoadMinVersion(int nVersion) { | ||||
AssertLockHeld(cs_wallet); | AssertLockHeld(cs_wallet); | ||||
nWalletVersion = nVersion; | nWalletVersion = nVersion; | ||||
nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); | nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); | ||||
return true; | return true; | ||||
} | } | ||||
void UpdateTimeFirstKey(int64_t nCreateTime); | void UpdateTimeFirstKey(int64_t nCreateTime); | ||||
▲ Show 20 Lines • Show All 385 Lines • Show Last 20 Lines |