Skip to content

Commit 9360f50

Browse files
committed
Drop extra script variable in ProduceSignature
Was slightly confusing.
1 parent d4991c0 commit 9360f50

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)