aboutsummaryrefslogtreecommitdiff
path: root/src/script.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-07-26 01:06:01 +0200
committerJaSK <temp@temp.temp>2014-07-02 15:48:37 +0200
commitc8988460a2865b99ee96da6799d37ac6ccb79d4d (patch)
tree359da0335ecd969209daa6f2ef3ddadc157b77f8 /src/script.h
parentdd49e92fb0cae0dcdf0b2ea303da99c7814db473 (diff)
downloadbitcoin-c8988460a2865b99ee96da6799d37ac6ccb79d4d.tar.xz
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/script.h')
-rw-r--r--src/script.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/script.h b/src/script.h
index 7ab471f6e6..1db758094e 100644
--- a/src/script.h
+++ b/src/script.h
@@ -194,6 +194,14 @@ enum
SCRIPT_VERIFY_NULLDUMMY = (1U << 4), // verify dummy stack item consumed by CHECKMULTISIG is of zero-length
};
+/** IsMine() return codes */
+enum isminetype
+{
+ MINE_NO = 0,
+ MINE_WATCH_ONLY = 1,
+ MINE_SPENDABLE = 2,
+};
+
// Mandatory script verification flags that all new blocks must comply with for
// them to be valid. (but old blocks may not comply with) Currently just P2SH,
// but in the future other flags may be added, such as a soft-fork to enforce
@@ -801,8 +809,8 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::vector<unsigned char> >& vSolutionsRet);
int ScriptSigArgsExpected(txnouttype t, const std::vector<std::vector<unsigned char> >& vSolutions);
bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType);
-bool IsMine(const CKeyStore& keystore, const CScript& scriptPubKey);
-bool IsMine(const CKeyStore& keystore, const CTxDestination &dest);
+isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey);
+isminetype IsMine(const CKeyStore& keystore, const CTxDestination &dest);
void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector<CKeyID> &vKeys);
bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet);
bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<CTxDestination>& addressRet, int& nRequiredRet);