|
|
@ -25,6 +25,8 @@ private: |
|
|
|
|
|
|
|
|
|
|
|
CWalletDB *pwalletdbEncryption; |
|
|
|
CWalletDB *pwalletdbEncryption; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int nWalletVersion; |
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
public: |
|
|
|
mutable CCriticalSection cs_wallet; |
|
|
|
mutable CCriticalSection cs_wallet; |
|
|
|
|
|
|
|
|
|
|
@ -33,18 +35,21 @@ public: |
|
|
|
|
|
|
|
|
|
|
|
std::set<int64> setKeyPool; |
|
|
|
std::set<int64> setKeyPool; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef std::map<unsigned int, CMasterKey> MasterKeyMap; |
|
|
|
typedef std::map<unsigned int, CMasterKey> MasterKeyMap; |
|
|
|
MasterKeyMap mapMasterKeys; |
|
|
|
MasterKeyMap mapMasterKeys; |
|
|
|
unsigned int nMasterKeyMaxID; |
|
|
|
unsigned int nMasterKeyMaxID; |
|
|
|
|
|
|
|
|
|
|
|
CWallet() |
|
|
|
CWallet() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
nWalletVersion = 0; |
|
|
|
fFileBacked = false; |
|
|
|
fFileBacked = false; |
|
|
|
nMasterKeyMaxID = 0; |
|
|
|
nMasterKeyMaxID = 0; |
|
|
|
pwalletdbEncryption = NULL; |
|
|
|
pwalletdbEncryption = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
CWallet(std::string strWalletFileIn) |
|
|
|
CWallet(std::string strWalletFileIn) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
nWalletVersion = 0; |
|
|
|
strWalletFile = strWalletFileIn; |
|
|
|
strWalletFile = strWalletFileIn; |
|
|
|
fFileBacked = true; |
|
|
|
fFileBacked = true; |
|
|
|
nMasterKeyMaxID = 0; |
|
|
|
nMasterKeyMaxID = 0; |
|
|
@ -61,11 +66,15 @@ public: |
|
|
|
std::vector<unsigned char> vchDefaultKey; |
|
|
|
std::vector<unsigned char> vchDefaultKey; |
|
|
|
|
|
|
|
|
|
|
|
// keystore implementation
|
|
|
|
// keystore implementation
|
|
|
|
|
|
|
|
// Generate a new key
|
|
|
|
|
|
|
|
std::vector<unsigned char> GenerateNewKey(); |
|
|
|
// Adds a key to the store, and saves it to disk.
|
|
|
|
// Adds a key to the store, and saves it to disk.
|
|
|
|
bool AddKey(const CKey& key); |
|
|
|
bool AddKey(const CKey& key); |
|
|
|
// 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) { return CCryptoKeyStore::AddKey(key); } |
|
|
|
bool LoadKey(const CKey& key) { return CCryptoKeyStore::AddKey(key); } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool LoadMinVersion(int nVersion) { nWalletVersion = nVersion; return true; } |
|
|
|
|
|
|
|
|
|
|
|
// Adds an encrypted key to the store, and saves it to disk.
|
|
|
|
// Adds an encrypted key to the store, and saves it to disk.
|
|
|
|
bool AddCryptedKey(const std::vector<unsigned char> &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret); |
|
|
|
bool AddCryptedKey(const std::vector<unsigned char> &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret); |
|
|
|
// Adds an encrypted key to the store, without saving it to disk (used by LoadWallet)
|
|
|
|
// Adds an encrypted key to the store, without saving it to disk (used by LoadWallet)
|
|
|
@ -206,6 +215,8 @@ public: |
|
|
|
bool GetTransaction(const uint256 &hashTx, CWalletTx& wtx); |
|
|
|
bool GetTransaction(const uint256 &hashTx, CWalletTx& wtx); |
|
|
|
|
|
|
|
|
|
|
|
bool SetDefaultKey(const std::vector<unsigned char> &vchPubKey); |
|
|
|
bool SetDefaultKey(const std::vector<unsigned char> &vchPubKey); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool SetMinVersion(int nVersion, CWalletDB* pwalletdbIn = NULL); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|