diff options
Diffstat (limited to 'src/wallet.h')
-rw-r--r-- | src/wallet.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/wallet.h b/src/wallet.h index 57633c4aa3..618a00623a 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -32,14 +32,14 @@ class CKeyPool { public: int64 nTime; - std::vector<unsigned char> vchPubKey; + CPubKey vchPubKey; CKeyPool() { nTime = GetTime(); } - CKeyPool(const std::vector<unsigned char>& vchPubKeyIn) + CKeyPool(const CPubKey& vchPubKeyIn) { nTime = GetTime(); vchPubKey = vchPubKeyIn; @@ -105,16 +105,16 @@ public: std::map<uint256, CWalletTx> mapWallet; std::map<uint256, int> mapRequestCount; - std::map<CBitcoinAddress, std::string> mapAddressBook; + std::map<CTxDestination, std::string> mapAddressBook; - std::vector<unsigned char> vchDefaultKey; + CPubKey vchDefaultKey; // check whether we are allowed to upgrade (or already support) to the named feature bool CanSupportFeature(enum WalletFeature wf) { return nWalletMaxVersion >= wf; } // keystore implementation // Generate a new key - std::vector<unsigned char> GenerateNewKey(); + CPubKey GenerateNewKey(); // Adds a key to the store, and saves it to disk. bool AddKey(const CKey& key); // Adds a key to the store, without saving it to disk (used by LoadWallet) @@ -123,9 +123,9 @@ public: bool LoadMinVersion(int nVersion) { nWalletVersion = nVersion; nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); return true; } // 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 CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret); // Adds an encrypted key to the store, without saving it to disk (used by LoadWallet) - bool LoadCryptedKey(const std::vector<unsigned char> &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret) { SetMinVersion(FEATURE_WALLETCRYPT); return CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret); } + bool LoadCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret) { SetMinVersion(FEATURE_WALLETCRYPT); return CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret); } bool AddCScript(const CScript& redeemScript); bool LoadCScript(const CScript& redeemScript) { return CCryptoKeyStore::AddCScript(redeemScript); } @@ -148,7 +148,7 @@ public: bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet); bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey); std::string SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, bool fAskFee=false); - std::string SendMoneyToBitcoinAddress(const CBitcoinAddress& address, int64 nValue, CWalletTx& wtxNew, bool fAskFee=false); + std::string SendMoneyToDestination(const CTxDestination &address, int64 nValue, CWalletTx& wtxNew, bool fAskFee=false); bool NewKeyPool(); bool TopUpKeyPool(); @@ -156,9 +156,9 @@ public: void ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool); void KeepKey(int64 nIndex); void ReturnKey(int64 nIndex); - bool GetKeyFromPool(std::vector<unsigned char> &key, bool fAllowReuse=true); + bool GetKeyFromPool(CPubKey &key, bool fAllowReuse=true); int64 GetOldestKeyPoolTime(); - void GetAllReserveAddresses(std::set<CBitcoinAddress>& setAddress); + void GetAllReserveKeys(std::set<CKeyID>& setAddress); bool IsMine(const CTxIn& txin) const; int64 GetDebit(const CTxIn& txin) const; @@ -227,9 +227,9 @@ public: int LoadWallet(bool& fFirstRunRet); - bool SetAddressBookName(const CBitcoinAddress& address, const std::string& strName); + bool SetAddressBookName(const CTxDestination& address, const std::string& strName); - bool DelAddressBookName(const CBitcoinAddress& address); + bool DelAddressBookName(const CTxDestination& address); void UpdatedTransaction(const uint256 &hashTx); @@ -252,7 +252,7 @@ public: bool GetTransaction(const uint256 &hashTx, CWalletTx& wtx); - bool SetDefaultKey(const std::vector<unsigned char> &vchPubKey); + bool SetDefaultKey(const CPubKey &vchPubKey); // signify that a particular wallet feature is now used. this may change nWalletVersion and nWalletMaxVersion if those are lower bool SetMinVersion(enum WalletFeature, CWalletDB* pwalletdbIn = NULL, bool fExplicit = false); @@ -266,7 +266,7 @@ public: /** Address book entry changed. * @note called with lock cs_wallet held. */ - boost::signals2::signal<void (CWallet *wallet, const std::string &address, const std::string &label, bool isMine, ChangeType status)> NotifyAddressBookChanged; + boost::signals2::signal<void (CWallet *wallet, const CTxDestination &address, const std::string &label, bool isMine, ChangeType status)> NotifyAddressBookChanged; /** Wallet transaction added, removed or updated. * @note called with lock cs_wallet held. @@ -280,7 +280,7 @@ class CReserveKey protected: CWallet* pwallet; int64 nIndex; - std::vector<unsigned char> vchPubKey; + CPubKey vchPubKey; public: CReserveKey(CWallet* pwalletIn) { @@ -295,7 +295,7 @@ public: } void ReturnKey(); - std::vector<unsigned char> GetReservedKey(); + CPubKey GetReservedKey(); void KeepKey(); }; @@ -532,8 +532,8 @@ public: return nChangeCached; } - void GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, std::list<std::pair<CBitcoinAddress, int64> >& listReceived, - std::list<std::pair<CBitcoinAddress, int64> >& listSent, int64& nFee, std::string& strSentAccount) const; + void GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, std::list<std::pair<CTxDestination, int64> >& listReceived, + std::list<std::pair<CTxDestination, int64> >& listSent, int64& nFee, std::string& strSentAccount) const; void GetAccountAmounts(const std::string& strAccount, int64& nGenerated, int64& nReceived, int64& nSent, int64& nFee) const; @@ -640,7 +640,7 @@ public: class CAccount { public: - std::vector<unsigned char> vchPubKey; + CPubKey vchPubKey; CAccount() { @@ -649,7 +649,7 @@ public: void SetNull() { - vchPubKey.clear(); + vchPubKey = CPubKey(); } IMPLEMENT_SERIALIZE |