mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-09-01 01:35:15 +00:00
txscript: Remove unneeded signature hash copies
These copies were likely left over from when MsgTx had no deep copy functionality.
This commit is contained in:
parent
51fca61707
commit
f8167ab36f
1 changed files with 0 additions and 10 deletions
|
@ -300,9 +300,6 @@ func calcSignatureHash(script []parsedOpcode, hashType SigHashType, tx *wire.Msg
|
||||||
// inputs that are not currently being processed.
|
// inputs that are not currently being processed.
|
||||||
txCopy := tx.Copy()
|
txCopy := tx.Copy()
|
||||||
for i := range txCopy.TxIn {
|
for i := range txCopy.TxIn {
|
||||||
var txIn wire.TxIn
|
|
||||||
txIn = *txCopy.TxIn[i]
|
|
||||||
txCopy.TxIn[i] = &txIn
|
|
||||||
if i == idx {
|
if i == idx {
|
||||||
// UnparseScript cannot fail here because removeOpcode
|
// UnparseScript cannot fail here because removeOpcode
|
||||||
// above only returns a valid script.
|
// above only returns a valid script.
|
||||||
|
@ -313,13 +310,6 @@ func calcSignatureHash(script []parsedOpcode, hashType SigHashType, tx *wire.Msg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default behavior has all outputs set up.
|
|
||||||
for i := range txCopy.TxOut {
|
|
||||||
var txOut wire.TxOut
|
|
||||||
txOut = *txCopy.TxOut[i]
|
|
||||||
txCopy.TxOut[i] = &txOut
|
|
||||||
}
|
|
||||||
|
|
||||||
switch hashType & sigHashMask {
|
switch hashType & sigHashMask {
|
||||||
case SigHashNone:
|
case SigHashNone:
|
||||||
txCopy.TxOut = txCopy.TxOut[0:0] // Empty slice.
|
txCopy.TxOut = txCopy.TxOut[0:0] // Empty slice.
|
||||||
|
|
Loading…
Add table
Reference in a new issue