7#ifndef BITCOIN_SCRIPT_INTERPRETER_H
8#define BITCOIN_SCRIPT_INTERPRETER_H
25bool CastToBool(
const std::vector<uint8_t> &vch);
40 virtual bool CheckSig(
const std::vector<uint8_t> &vchSigIn,
41 const std::vector<uint8_t> &vchPubKey,
70 const T *txToIn,
unsigned int nInIn,
const Amount &amountIn,
75 bool CheckSig(
const std::vector<uint8_t> &vchSigIn,
76 const std::vector<uint8_t> &vchPubKey,
78 uint32_t
flags)
const final override;
91 std::vector<std::vector<uint8_t>> &
stack;
169static inline bool EvalScript(std::vector<std::vector<uint8_t>> &stack,
virtual bool VerifySignature(const std::vector< uint8_t > &vchSig, const CPubKey &vchPubKey, const uint256 &sighash) const
virtual bool CheckLockTime(const CScriptNum &nLockTime) const
virtual bool CheckSequence(const CScriptNum &nSequence) const
virtual bool CheckSig(const std::vector< uint8_t > &vchSigIn, const std::vector< uint8_t > &vchPubKey, const CScript &scriptCode, uint32_t flags) const
virtual ~BaseSignatureChecker()
An encapsulated public key.
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
A data type to abstract out the condition stack during script execution.
bool CheckSig(const std::vector< uint8_t > &vchSigIn, const std::vector< uint8_t > &vchPubKey, const CScript &scriptCode, uint32_t flags) const final override
const PrecomputedTransactionData * txdata
bool CheckSequence(const CScriptNum &nSequence) const final override
GenericTransactionSignatureChecker(const T *txToIn, unsigned int nInIn, const Amount &amountIn)
GenericTransactionSignatureChecker(const T *txToIn, unsigned int nInIn, const Amount &amountIn, const PrecomputedTransactionData &txdataIn)
bool CheckLockTime(const CScriptNum &nLockTime) const final override
CScript::const_iterator pend
bool CheckPostConditions()
const std::vector< std::vector< uint8_t > > & GetStack() const
const std::vector< std::vector< uint8_t > > & GetAltStack() const
std::vector< std::vector< uint8_t > > altstack
CScript::const_iterator pbegincodehash
ScriptError GetScriptError()
const ConditionStack & GetConditionStack()
const BaseSignatureChecker & checker
bool CheckPreConditions()
CScript::const_iterator pc
ScriptInterpreter(std::vector< std::vector< uint8_t > > &stack, const CScript &script, uint32_t flags, const BaseSignatureChecker &checker, ScriptExecutionMetrics &metrics)
std::vector< std::vector< uint8_t > > & stack
bool GetNextOp(opcodetype &opcodeRet, std::vector< uint8_t > &vchRet) const
ScriptExecutionMetrics & metrics
Signature hash type wrapper class.
bool VerifyScript(const CScript &scriptSig, const CScript &scriptPubKey, uint32_t flags, const BaseSignatureChecker &checker, ScriptExecutionMetrics &metricsOut, ScriptError *serror=nullptr)
Execute an unlocking and locking script together.
int FindAndDelete(CScript &script, const CScript &b)
bool CastToBool(const std::vector< uint8_t > &vch)
uint256 SignatureHash(const CScript &scriptCode, const T &txTo, unsigned int nIn, SigHashType sigHashType, const Amount amount, const PrecomputedTransactionData *cache=nullptr, uint32_t flags=SCRIPT_ENABLE_SIGHASH_FORKID)
bool EvalScript(std::vector< std::vector< uint8_t > > &stack, const CScript &script, uint32_t flags, const BaseSignatureChecker &checker, ScriptExecutionMetrics &metrics, ScriptError *error=nullptr)
bool error(const char *fmt, const Args &...args)
opcodetype
Script opcodes.
@ SCRIPT_ENABLE_SIGHASH_FORKID
Precompute sighash midstate to avoid quadratic hashing.
Struct for holding cumulative results from executing a script or a sequence of scripts.