SIGHASH_ALL = 1,
SIGHASH_NONE = 2,
SIGHASH_SINGLE = 3,
- SIGHASH_ANYONECANPAY = 0x80,
+ SIGHASH_ANYONECANPAY = 0x80
};
/** Script verification flags */
SCRIPT_VERIFY_STRICTENC = (1U << 1), // enforce strict conformance to DER and SEC2 for signatures and pubkeys
SCRIPT_VERIFY_LOW_S = (1U << 2), // enforce low S values in signatures (depends on STRICTENC)
SCRIPT_VERIFY_NOCACHE = (1U << 3), // do not store results in signature cache (but do query it)
- SCRIPT_VERIFY_NULLDUMMY = (1U << 4), // verify dummy stack item consumed by CHECKMULTISIG is of zero-length
+ SCRIPT_VERIFY_NULLDUMMY = (1U << 4) // verify dummy stack item consumed by CHECKMULTISIG is of zero-length
};
// Strict verification:
// blocks and we must accept those blocks.
static const unsigned int STRICT_FLAGS = MANDATORY_SCRIPT_VERIFY_FLAGS | STRICT_FORMAT_FLAGS;
-// Soft verifications, no extended signature format checkings
-static const unsigned int SOFT_FLAGS = STRICT_FLAGS & ~STRICT_FORMAT_FLAGS;
-
enum txnouttype
{
TX_NONSTANDARD,
// 'standard' transaction types:
TX_PUBKEY,
+ TX_PUBKEY_DROP,
TX_PUBKEYHASH,
TX_SCRIPTHASH,
TX_MULTISIG,
- TX_NULL_DATA,
+ TX_NULL_DATA
};
const char* GetTxnOutputType(txnouttype t);
OP_PUBKEYHASH = 0xfd,
OP_PUBKEY = 0xfe,
- OP_INVALIDOPCODE = 0xff,
+ OP_INVALIDOPCODE = 0xff
};
const char* GetOpName(opcodetype opcode);
if (opcode == OP_0)
return 0;
assert(opcode >= OP_1 && opcode <= OP_16);
- return (int)opcode - (int)(OP_1 - 1);
+ return (opcode - (OP_1 - 1));
}
static opcodetype EncodeOP_N(int n)
{
};
bool IsCanonicalPubKey(const std::vector<unsigned char> &vchPubKey, unsigned int flags);
+bool IsDERSignature(const valtype &vchSig, bool fWithHashType=false, bool fCheckLow=false);
bool IsCanonicalSignature(const std::vector<unsigned char> &vchSig, unsigned int flags);
-
bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType);
bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::vector<unsigned char> >& vSolutionsRet);
int ScriptSigArgsExpected(txnouttype t, const std::vector<std::vector<unsigned char> >& vSolutions);
// Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders,
// combine them intelligently and return the result.
-CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2);
+CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2);
#endif