Skip to content

Commit a3791da

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#22428: [Refactor] Rename scriptPubKey -> exec_script
0079103 [Refactor] Rename scriptPubKey -> exec_script (sanket1729) Pull request description: Rename scriptPubKey to witness_script in ExecuteWitnessScript() function to correctly reflect which script is being executed. For example in segwitv0, this scriptPubKey refers to the script of the form `OP_0 <script_hash>`, but witness_script refers to the script that actually hashes to the `script_hash`. If there is a reason why it's named this way, I would love to know ACKs for top commit: MarcoFalke: review ACK 0079103 🖖 theStack: ACK 0079103 lsilva01: Code Review bitcoin/bitcoin@0079103 ACK Tree-SHA512: 768e10e656b60b1293beb560fb7adbc2c1495e6db1f54f0c2c63109692ae0c579c856b194b33f72afd0d332159a9796c0e2bd99b79ea5c4b1803469a81301fd6
2 parents cac38cd + 0079103 commit a3791da

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)