Skip to content

Commit 0079103

Browse files
committed
[Refactor] Rename scriptPubKey -> exec_script
Rename misleading scriptPubKey in ExecuteWitnessScript() function to correctly relfect what is being executed.
1 parent 8ab0c77 commit 0079103

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/script/interpreter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,16 +1807,16 @@ bool GenericTransactionSignatureChecker<T>::CheckSequence(const CScriptNum& nSeq
18071807
template class GenericTransactionSignatureChecker<CTransaction>;
18081808
template class GenericTransactionSignatureChecker<CMutableTransaction>;
18091809

1810-
static bool ExecuteWitnessScript(const Span<const valtype>& stack_span, const CScript& scriptPubKey, unsigned int flags, SigVersion sigversion, const BaseSignatureChecker& checker, ScriptExecutionData& execdata, ScriptError* serror)
1810+
static bool ExecuteWitnessScript(const Span<const valtype>& stack_span, const CScript& exec_script, unsigned int flags, SigVersion sigversion, const BaseSignatureChecker& checker, ScriptExecutionData& execdata, ScriptError* serror)
18111811
{
18121812
std::vector<valtype> stack{stack_span.begin(), stack_span.end()};
18131813

18141814
if (sigversion == SigVersion::TAPSCRIPT) {
18151815
// OP_SUCCESSx processing overrides everything, including stack element size limits
1816-
CScript::const_iterator pc = scriptPubKey.begin();
1817-
while (pc < scriptPubKey.end()) {
1816+
CScript::const_iterator pc = exec_script.begin();
1817+
while (pc < exec_script.end()) {
18181818
opcodetype opcode;
1819-
if (!scriptPubKey.GetOp(pc, opcode)) {
1819+
if (!exec_script.GetOp(pc, opcode)) {
18201820
// Note how this condition would not be reached if an unknown OP_SUCCESSx was found
18211821
return set_error(serror, SCRIPT_ERR_BAD_OPCODE);
18221822
}
@@ -1839,7 +1839,7 @@ static bool ExecuteWitnessScript(const Span<const valtype>& stack_span, const CS
18391839
}
18401840

18411841
// Run the script interpreter.
1842-
if (!EvalScript(stack, scriptPubKey, flags, checker, sigversion, execdata, serror)) return false;
1842+
if (!EvalScript(stack, exec_script, flags, checker, sigversion, execdata, serror)) return false;
18431843

18441844
// Scripts inside witness implicitly require cleanstack behaviour
18451845
if (stack.size() != 1) return set_error(serror, SCRIPT_ERR_CLEANSTACK);

0 commit comments

Comments
 (0)