Updates for txscript.NewScript API change.

This commit is contained in:
Josh Rickmar 2015-04-20 16:52:26 -04:00
parent ab8a155841
commit 0d7b8af543
3 changed files with 7 additions and 9 deletions

View file

@ -2834,8 +2834,8 @@ func SignRawTransaction(w *wallet.Wallet, chainSvr *chain.Client, icmd btcjson.C
// Either it was already signed or we just signed it. // Either it was already signed or we just signed it.
// Find out if it is completely satisfied or still needs more. // Find out if it is completely satisfied or still needs more.
engine, err := txscript.NewScript(txIn.SignatureScript, input, engine, err := txscript.NewScript(input, msgTx, i,
i, msgTx, txscript.StandardVerifyFlags) txscript.StandardVerifyFlags)
if err != nil || engine.Execute() != nil { if err != nil || engine.Execute() != nil {
complete = false complete = false
} }

View file

@ -844,9 +844,8 @@ func signMultiSigUTXO(mgr *waddrmgr.Manager, tx *wire.MsgTx, idx int, pkScript [
// validateSigScripts executes the signature script of the tx input with the // validateSigScripts executes the signature script of the tx input with the
// given index, returning an error if it fails. // given index, returning an error if it fails.
func validateSigScript(msgtx *wire.MsgTx, idx int, pkScript []byte) error { func validateSigScript(msgtx *wire.MsgTx, idx int, pkScript []byte) error {
txIn := msgtx.TxIn[idx] engine, err := txscript.NewScript(pkScript, msgtx, idx,
engine, err := txscript.NewScript( txscript.StandardVerifyFlags)
txIn.SignatureScript, pkScript, idx, msgtx, txscript.StandardVerifyFlags)
if err != nil { if err != nil {
return newError(ErrTxSigning, "cannot create script engine", err) return newError(ErrTxSigning, "cannot create script engine", err)
} }

View file

@ -403,10 +403,9 @@ func signMsgTx(msgtx *wire.MsgTx, prevOutputs []txstore.Credit, mgr *waddrmgr.Ma
} }
func validateMsgTx(msgtx *wire.MsgTx, prevOutputs []txstore.Credit) error { func validateMsgTx(msgtx *wire.MsgTx, prevOutputs []txstore.Credit) error {
for i, txin := range msgtx.TxIn { for i := range msgtx.TxIn {
engine, err := txscript.NewScript( engine, err := txscript.NewScript(prevOutputs[i].TxOut().PkScript,
txin.SignatureScript, prevOutputs[i].TxOut().PkScript, msgtx, i, txscript.StandardVerifyFlags)
i, msgtx, txscript.StandardVerifyFlags)
if err != nil { if err != nil {
return fmt.Errorf("cannot create script engine: %s", err) return fmt.Errorf("cannot create script engine: %s", err)
} }