Skip to content

Commit 47a7666

Browse files
committed
Merge #11889: Drop extra script variable in ProduceSignature
9360f50 Drop extra script variable in ProduceSignature (Russell Yanofsky) Pull request description: Was slightly confusing. Tree-SHA512: 1d18f92c133772ffc8eb71826c8d778988839a14bcefc50f9c591111b0a5f81ebc12bca0f1ab25d5fdd02d3d50c2325c04cbfcbdcd18a7b80ca112d049c2327d
2 parents 7f99964 + 9360f50 commit 47a7666

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/script/sign.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,9 @@ static CScript PushAll(const std::vector<valtype>& values)
140140

141141
bool ProduceSignature(const BaseSignatureCreator& creator, const CScript& fromPubKey, SignatureData& sigdata)
142142
{
143-
CScript script = fromPubKey;
144143
std::vector<valtype> result;
145144
txnouttype whichType;
146-
bool solved = SignStep(creator, script, result, whichType, SIGVERSION_BASE);
145+
bool solved = SignStep(creator, fromPubKey, result, whichType, SIGVERSION_BASE);
147146
bool P2SH = false;
148147
CScript subscript;
149148
sigdata.scriptWitness.stack.clear();
@@ -153,8 +152,8 @@ bool ProduceSignature(const BaseSignatureCreator& creator, const CScript& fromPu
153152
// Solver returns the subscript that needs to be evaluated;
154153
// the final scriptSig is the signatures from that
155154
// and then the serialized subscript:
156-
script = subscript = CScript(result[0].begin(), result[0].end());
157-
solved = solved && SignStep(creator, script, result, whichType, SIGVERSION_BASE) && whichType != TX_SCRIPTHASH;
155+
subscript = CScript(result[0].begin(), result[0].end());
156+
solved = solved && SignStep(creator, subscript, result, whichType, SIGVERSION_BASE) && whichType != TX_SCRIPTHASH;
158157
P2SH = true;
159158
}
160159

0 commit comments

Comments
 (0)