X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fscript.h;h=4492f2a1b62a17d0e14c1db03e105d2a11053600;hb=580fa137c61abe24c56b440e62fa21657227e9a2;hp=60ef0e45706ba800c422ed6e14e4e405abd43cf3;hpb=a5240a08a7d624d20344344b79441c67311f7fd9;p=novacoin.git diff --git a/src/script.h b/src/script.h index 60ef0e4..4492f2a 100644 --- a/src/script.h +++ b/src/script.h @@ -9,7 +9,6 @@ #include #include -#include #include "keystore.h" #include "bignum.h" @@ -20,6 +19,14 @@ class CTransaction; static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes +/** IsMine() return codes */ +enum isminetype +{ + MINE_NO = 0, + MINE_WATCH_ONLY = 1, + MINE_SPENDABLE = 2, +}; + /** Signature hash types/flags */ enum { @@ -75,20 +82,6 @@ enum txnouttype TX_NULL_DATA, }; -class CNoDestination { -public: - friend bool operator==(const CNoDestination &a, const CNoDestination &b) { return true; } - friend bool operator<(const CNoDestination &a, const CNoDestination &b) { return true; } -}; - -/** A txout script template with a specific destination. It is either: - * * CNoDestination: no destination set - * * CKeyID: TX_PUBKEYHASH destination - * * CScriptID: TX_SCRIPTHASH destination - * A CTxDestination is the internal data type encoded in a CBitcoinAddress - */ -typedef boost::variant CTxDestination; - const char* GetTxnOutputType(txnouttype t); /** Script opcodes */ @@ -629,8 +622,8 @@ bool EvalScript(std::vector >& stack, const CScript& bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector >& vSolutionsRet); int ScriptSigArgsExpected(txnouttype t, const std::vector >& 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 &vKeys); bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet); bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector& addressRet, int& nRequiredRet);