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
This commit is contained in:
gavinandresen
2010-12-07 13:43:31 +00:00
parent 865c3a2383
commit a206a23980
6 changed files with 49 additions and 11 deletions

View File

@@ -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);