aboutsummaryrefslogtreecommitdiff
path: root/src/script.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2012-02-07 09:04:56 -0500
committerGavin Andresen <[email protected]>2012-02-07 09:04:56 -0500
commit0b452dff5e9f1401343b6c52ef739014d81fa8c6 (patch)
treee707c5982ee5f2a0a99b7e563c69d58414222eb7 /src/script.cpp
parent-bip16 option (default: 1) to support / not support BIP 16. And bumped defaul... (diff)
parentMake transactions with extra data in their scriptSig's non-standard. (diff)
downloaddiscoin-0b452dff5e9f1401343b6c52ef739014d81fa8c6.tar.xz
discoin-0b452dff5e9f1401343b6c52ef739014d81fa8c6.zip
Merge branch 'standardScriptSigs' of github.com:gavinandresen/bitcoin-git
Diffstat (limited to 'src/script.cpp')
-rw-r--r--src/script.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/script.cpp b/src/script.cpp
index 66962d78b..c0523855b 100644
--- a/src/script.cpp
+++ b/src/script.cpp
@@ -1312,6 +1312,25 @@ bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash
return false;
}
+int ScriptSigArgsExpected(txnouttype t, const std::vector<std::vector<unsigned char> >& vSolutions)
+{
+ switch (t)
+ {
+ case TX_NONSTANDARD:
+ return -1;
+ case TX_PUBKEY:
+ return 1;
+ case TX_PUBKEYHASH:
+ return 2;
+ case TX_MULTISIG:
+ if (vSolutions.size() < 1 || vSolutions[0].size() < 1)
+ return -1;
+ return vSolutions[0][0] + 1;
+ case TX_SCRIPTHASH:
+ return 1; // doesn't include args needed by the script
+ }
+ return -1;
+}
bool IsStandard(const CScript& scriptPubKey)
{