Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.h
Show All 17 Lines | |||||
class CTransaction; | class CTransaction; | ||||
class uint256; | class uint256; | ||||
/** Signature hash types/flags */ | /** Signature hash types/flags */ | ||||
enum { | enum { | ||||
SIGHASH_ALL = 1, | SIGHASH_ALL = 1, | ||||
SIGHASH_NONE = 2, | SIGHASH_NONE = 2, | ||||
SIGHASH_SINGLE = 3, | SIGHASH_SINGLE = 3, | ||||
SIGHASH_SPENDANYOUTPUT = 0x20, | |||||
SIGHASH_FORKID = 0x40, | SIGHASH_FORKID = 0x40, | ||||
SIGHASH_ANYONECANPAY = 0x80, | SIGHASH_ANYONECANPAY = 0x80, | ||||
}; | }; | ||||
/** Script verification flags */ | /** Script verification flags */ | ||||
enum { | enum { | ||||
SCRIPT_VERIFY_NONE = 0, | SCRIPT_VERIFY_NONE = 0, | ||||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | enum { | ||||
// Public keys in scripts must be compressed | // Public keys in scripts must be compressed | ||||
// | // | ||||
SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE = (1U << 15), | SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE = (1U << 15), | ||||
// Do we accept signature using SIGHASH_FORKID | // Do we accept signature using SIGHASH_FORKID | ||||
// | // | ||||
SCRIPT_ENABLE_SIGHASH_FORKID = (1U << 16), | SCRIPT_ENABLE_SIGHASH_FORKID = (1U << 16), | ||||
// Do we accept signature using SIGHASH_SPENDANYOUTPUT | |||||
// | |||||
SCRIPT_ENABLE_SIGHASH_SPENDANYOUTPUT = (1U << 17), | |||||
}; | }; | ||||
bool CheckSignatureEncoding(const std::vector<uint8_t> &vchSig, uint32_t flags, | bool CheckSignatureEncoding(const std::vector<uint8_t> &vchSig, uint32_t flags, | ||||
ScriptError *serror); | ScriptError *serror); | ||||
uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, | uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, | ||||
unsigned int nIn, uint32_t nHashType, | unsigned int nIn, uint32_t nHashType, | ||||
const Amount &amount, | const Amount &amount, const CScript &scriptPubKey, | ||||
const PrecomputedTransactionData *cache = nullptr, | const PrecomputedTransactionData *cache = nullptr, | ||||
uint32_t flags = SCRIPT_ENABLE_SIGHASH_FORKID); | uint32_t flags = SCRIPT_ENABLE_SIGHASH_FORKID); | ||||
class BaseSignatureChecker { | class BaseSignatureChecker { | ||||
public: | public: | ||||
virtual bool CheckSig(const std::vector<uint8_t> &scriptSig, | virtual bool CheckSig(const std::vector<uint8_t> &scriptSig, | ||||
const std::vector<uint8_t> &vchPubKey, | const std::vector<uint8_t> &vchPubKey, | ||||
const CScript &scriptCode, uint32_t flags) const { | const CScript &scriptCode, uint32_t flags) const { | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |