aboutsummaryrefslogtreecommitdiff
path: root/script.h
diff options
context:
space:
mode:
authorgavinandresen <gavinandresen@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-12-07 13:43:31 +0000
committergavinandresen <gavinandresen@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-12-07 13:43:31 +0000
commita206a23980c15cacf39d267c509bd70c23c94bfa (patch)
tree7a4e29a09bbf32fb9f84abefdd8eb9504195fa32 /script.h
parent865c3a23832e36d50cb873d38c976032b027b5d3 (diff)
downloadbitcoin-a206a23980c15cacf39d267c509bd70c23c94bfa.tar.xz
IsStandard() check for CScripts: only relay/include in blocks CScripts we can understand.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@197 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'script.h')
-rw-r--r--script.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/script.h b/script.h
index c829ed053e..f724d99793 100644
--- a/script.h
+++ b/script.h
@@ -597,6 +597,21 @@ public:
}
+ bool IsPushOnly() const
+ {
+ const_iterator pc = begin();
+ while (pc < end())
+ {
+ opcodetype opcode;
+ if (!GetOp(pc, opcode))
+ return false;
+ if (opcode > OP_16)
+ return false;
+ }
+ return true;
+ }
+
+
uint160 GetBitcoinAddressHash160() const
{
opcodetype opcode;
@@ -684,6 +699,7 @@ public:
uint256 SignatureHash(CScript scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType);
+bool IsStandard(const CScript& scriptPubKey);
bool IsMine(const CScript& scriptPubKey);
bool ExtractPubKey(const CScript& scriptPubKey, bool fMineOnly, vector<unsigned char>& vchPubKeyRet);
bool ExtractHash160(const CScript& scriptPubKey, uint160& hash160Ret);