From f8167ab36f9987403de53c6997dcbc170a841f84 Mon Sep 17 00:00:00 2001 From: Jonathan Gillham Date: Tue, 28 Jul 2015 11:31:43 +0100 Subject: [PATCH] txscript: Remove unneeded signature hash copies These copies were likely left over from when MsgTx had no deep copy functionality. --- txscript/script.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/txscript/script.go b/txscript/script.go index 333774c6..a811680a 100644 --- a/txscript/script.go +++ b/txscript/script.go @@ -300,9 +300,6 @@ func calcSignatureHash(script []parsedOpcode, hashType SigHashType, tx *wire.Msg // inputs that are not currently being processed. txCopy := tx.Copy() for i := range txCopy.TxIn { - var txIn wire.TxIn - txIn = *txCopy.TxIn[i] - txCopy.TxIn[i] = &txIn if i == idx { // UnparseScript cannot fail here because removeOpcode // 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 { case SigHashNone: txCopy.TxOut = txCopy.TxOut[0:0] // Empty slice.