Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.h
Show All 27 Lines | uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, | ||||
uint32_t flags = SCRIPT_ENABLE_SIGHASH_FORKID); | uint32_t flags = SCRIPT_ENABLE_SIGHASH_FORKID); | ||||
class BaseSignatureChecker { | class BaseSignatureChecker { | ||||
public: | public: | ||||
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) const; | ||||
virtual bool CheckSig(const std::vector<uint8_t> &scriptSig, | 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 { | ||||
return false; | return false; | ||||
} | } | ||||
Show All 17 Lines | TransactionSignatureChecker(const CTransaction *txToIn, unsigned int nInIn, | ||||
const Amount amountIn) | const Amount amountIn) | ||||
: txTo(txToIn), nIn(nInIn), amount(amountIn), txdata(nullptr) {} | : txTo(txToIn), nIn(nInIn), amount(amountIn), txdata(nullptr) {} | ||||
TransactionSignatureChecker(const CTransaction *txToIn, unsigned int nInIn, | TransactionSignatureChecker(const CTransaction *txToIn, unsigned int nInIn, | ||||
const Amount amountIn, | const Amount amountIn, | ||||
const PrecomputedTransactionData &txdataIn) | const PrecomputedTransactionData &txdataIn) | ||||
: txTo(txToIn), nIn(nInIn), amount(amountIn), txdata(&txdataIn) {} | : txTo(txToIn), nIn(nInIn), amount(amountIn), txdata(&txdataIn) {} | ||||
// The overriden functions are now final. | // The overriden functions are now final. | ||||
bool CheckSig(const std::vector<uint8_t> &scriptSig, | bool CheckSig(const std::vector<uint8_t> &vchSigIn, | ||||
const std::vector<uint8_t> &vchPubKey, | const std::vector<uint8_t> &vchPubKey, | ||||
const CScript &scriptCode, | const CScript &scriptCode, | ||||
uint32_t flags) const final override; | uint32_t flags) const final override; | ||||
bool CheckLockTime(const CScriptNum &nLockTime) const final override; | bool CheckLockTime(const CScriptNum &nLockTime) const final override; | ||||
bool CheckSequence(const CScriptNum &nSequence) const final override; | bool CheckSequence(const CScriptNum &nSequence) const final override; | ||||
}; | }; | ||||
class MutableTransactionSignatureChecker : public TransactionSignatureChecker { | class MutableTransactionSignatureChecker : public TransactionSignatureChecker { | ||||
Show All 18 Lines |