Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.h
Show All 23 Lines | |||||
uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, | uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, | ||||
unsigned int nIn, SigHashType sigHashType, | unsigned int nIn, SigHashType sigHashType, | ||||
const Amount amount, | const Amount amount, | ||||
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: | ||||
/** | |||||
* Declare which flags absolutely do not affect VerifySignature() result. | |||||
* The caching code in sighash.cpp uses this to reduce the number of | |||||
* duplicated entries. | |||||
*/ | |||||
static const uint32_t invariantFlagsVerifySignature = | |||||
SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC | SCRIPT_VERIFY_DERSIG | | |||||
SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_NULLDUMMY | | |||||
SCRIPT_VERIFY_SIGPUSHONLY | SCRIPT_VERIFY_MINIMALDATA | | |||||
SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS | SCRIPT_VERIFY_CLEANSTACK | | |||||
SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY | SCRIPT_VERIFY_CHECKSEQUENCEVERIFY | | |||||
SCRIPT_VERIFY_MINIMALIF | SCRIPT_VERIFY_NULLFAIL | | |||||
SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE | SCRIPT_ENABLE_SIGHASH_FORKID | | |||||
SCRIPT_ENABLE_REPLAY_PROTECTION | SCRIPT_ENABLE_CHECKDATASIG; | |||||
deadalnix: It's not the responsibility of the script system to know what flags affect the validity of a… | |||||
markblundebergAuthorUnsubmitted Done Inline ActionsOk. markblundeberg: Ok. | |||||
virtual bool VerifySignature(const std::vector<uint8_t> &vchSig, | virtual bool VerifySignature(const std::vector<uint8_t> &vchSig, | ||||
const CPubKey &vchPubKey, | const CPubKey &vchPubKey, | ||||
const uint256 &sighash) const; | const uint256 &sighash, uint32_t flags) const; | ||||
virtual bool CheckSig(const std::vector<uint8_t> &vchSigIn, | virtual bool CheckSig(const std::vector<uint8_t> &vchSigIn, | ||||
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 { | ||||
return false; | return false; | ||||
} | } | ||||
virtual bool CheckLockTime(const CScriptNum &nLockTime) const { | virtual bool CheckLockTime(const CScriptNum &nLockTime) const { | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |
It's not the responsibility of the script system to know what flags affect the validity of a signature, because it's not the responsibility of the script system to validate a signature.