Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.h
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | public: | ||||
bool CheckSequence(const CScriptNum &nSequence) const final override; | bool CheckSequence(const CScriptNum &nSequence) const final override; | ||||
}; | }; | ||||
using TransactionSignatureChecker = | using TransactionSignatureChecker = | ||||
GenericTransactionSignatureChecker<CTransaction>; | GenericTransactionSignatureChecker<CTransaction>; | ||||
using MutableTransactionSignatureChecker = | using MutableTransactionSignatureChecker = | ||||
GenericTransactionSignatureChecker<CMutableTransaction>; | GenericTransactionSignatureChecker<CMutableTransaction>; | ||||
/** | |||||
* Struct for holding cumulative results from executing a script or a sequence | |||||
* of scripts. | |||||
*/ | |||||
struct ScriptExecutionMetrics { | |||||
int nSigChecks = 0; | |||||
}; | |||||
bool EvalScript(std::vector<std::vector<uint8_t>> &stack, const CScript &script, | bool EvalScript(std::vector<std::vector<uint8_t>> &stack, const CScript &script, | ||||
uint32_t flags, const BaseSignatureChecker &checker, | uint32_t flags, const BaseSignatureChecker &checker, | ||||
ScriptError *error = nullptr); | ScriptExecutionMetrics &metrics, ScriptError *error = nullptr); | ||||
static inline bool EvalScript(std::vector<std::vector<uint8_t>> &stack, | |||||
const CScript &script, uint32_t flags, | |||||
const BaseSignatureChecker &checker, | |||||
ScriptError *error = nullptr) { | |||||
ScriptExecutionMetrics dummymetrics; | |||||
return EvalScript(stack, script, flags, checker, dummymetrics, error); | |||||
} | |||||
bool VerifyScript(const CScript &scriptSig, const CScript &scriptPubKey, | bool VerifyScript(const CScript &scriptSig, const CScript &scriptPubKey, | ||||
uint32_t flags, const BaseSignatureChecker &checker, | uint32_t flags, const BaseSignatureChecker &checker, | ||||
ScriptError *serror = nullptr); | ScriptError *serror = nullptr); | ||||
int FindAndDelete(CScript &script, const CScript &b); | int FindAndDelete(CScript &script, const CScript &b); | ||||
#endif // BITCOIN_SCRIPT_INTERPRETER_H | #endif // BITCOIN_SCRIPT_INTERPRETER_H |