diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2013-07-26 01:06:01 +0200 |
---|---|---|
committer | JaSK <temp@temp.temp> | 2014-07-02 15:48:37 +0200 |
commit | c8988460a2865b99ee96da6799d37ac6ccb79d4d (patch) | |
tree | 359da0335ecd969209daa6f2ef3ddadc157b77f8 /src/wallet.h | |
parent | dd49e92fb0cae0dcdf0b2ea303da99c7814db473 (diff) |
Add support for watch-only addresses
Changes:
* Add Add/Have WatchOnly methods to CKeyStore, and implementations
in CBasicKeyStore.
* Add similar methods to CWallet, and support entries for it in
CWalletDB.
* Make IsMine in script/wallet return a new enum 'isminetype',
rather than a boolean. This allows distinguishing between
spendable and unspendable coins.
* Add a field fSpendable to COutput (GetAvailableCoins' return type).
* Mark watchonly coins in listunspent as 'watchonly': true.
* Add 'watchonly' to validateaddress, suppressing script/pubkey/...
in this case.
Based on a patch by Eric Lombrozo.
Conflicts:
src/qt/walletmodel.cpp
src/rpcserver.cpp
src/wallet.cpp
Diffstat (limited to 'src/wallet.h')
-rw-r--r-- | src/wallet.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/wallet.h b/src/wallet.h index 1c2512d678..ff6af3a6a8 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -226,6 +226,11 @@ public: /// Look up a destination data tuple in the store, return true if found false otherwise bool GetDestData(const CTxDestination &dest, const std::string &key, std::string *value) const; + // Adds a watch-only address to the store, and saves it to disk. + bool AddWatchOnly(const CTxDestination &dest); + // Adds a watch-only address to the store, without saving it to disk (used by LoadWallet) + bool LoadWatchOnly(const CTxDestination &dest); + bool Unlock(const SecureString& strWalletPassphrase); bool ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase); bool EncryptWallet(const SecureString& strWalletPassphrase); @@ -279,9 +284,9 @@ public: std::set<CTxDestination> GetAccountAddresses(std::string strAccount) const; - bool IsMine(const CTxIn& txin) const; + isminetype IsMine(const CTxIn& txin) const; int64_t GetDebit(const CTxIn& txin) const; - bool IsMine(const CTxOut& txout) const + isminetype IsMine(const CTxOut& txout) const { return ::IsMine(*this, txout.scriptPubKey); } @@ -722,10 +727,11 @@ public: const CWalletTx *tx; int i; int nDepth; + bool fSpendable; - COutput(const CWalletTx *txIn, int iIn, int nDepthIn) + COutput(const CWalletTx *txIn, int iIn, int nDepthIn, bool fSpendableIn) { - tx = txIn; i = iIn; nDepth = nDepthIn; + tx = txIn; i = iIn; nDepth = nDepthIn; fSpendable = fSpendableIn; } std::string ToString() const |