diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2012-01-19 13:30:54 -0500 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2012-01-19 13:30:54 -0500 |
commit | 39f0d9686095bce469dbfa52333331a5d15c6545 (patch) | |
tree | cbbe1525c2faee1ba826c1a3ab6a8e36e95f7230 /src/script.cpp | |
parent | 43cda5f325f53e8941efa7f712aed66e3fde172a (diff) |
Make transactions with extra data in their scriptSig's non-standard.
Diffstat (limited to 'src/script.cpp')
-rw-r--r-- | src/script.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/script.cpp b/src/script.cpp index 66962d78b3..c0523855bd 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) { |