aboutsummaryrefslogtreecommitdiff
path: root/src/script.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/script.h')
-rw-r--r--src/script.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/script.h b/src/script.h
index 7b0643f70a..4b29f6273c 100644
--- a/src/script.h
+++ b/src/script.h
@@ -17,6 +17,8 @@
class CCoins;
class CTransaction;
+static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes
+
/** Signature hash types/flags */
enum
{
@@ -32,6 +34,7 @@ enum
SCRIPT_VERIFY_NONE = 0,
SCRIPT_VERIFY_P2SH = (1U << 0),
SCRIPT_VERIFY_STRICTENC = (1U << 1),
+ SCRIPT_VERIFY_NOCACHE = (1U << 2),
};
enum txnouttype
@@ -434,7 +437,7 @@ public:
// Immediate operand
if (opcode <= OP_PUSHDATA4)
{
- unsigned int nSize;
+ unsigned int nSize = 0;
if (opcode < OP_PUSHDATA1)
{
nSize = opcode;
@@ -646,7 +649,7 @@ public:
template<typename Stream>
void Unserialize(Stream &s, int nType, int nVersion) {
- unsigned int nSize;
+ unsigned int nSize = 0;
s >> VARINT(nSize);
if (nSize < nSpecialScripts) {
std::vector<unsigned char> vch(GetSpecialSize(nSize), 0x00);
@@ -673,9 +676,7 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet)
bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<CTxDestination>& addressRet, int& nRequiredRet);
bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL);
bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL);
-bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn,
- unsigned int flags, int nHashType);
-bool VerifySignature(const CCoins& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType);
+bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType);
// Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders,
// combine them intelligently and return the result.