use WitnessSignatureScript

This commit is contained in:
Tadge Dryja 2016-02-21 14:28:47 -08:00
parent 05590279b2
commit cb3b20ad6c

@ -201,11 +201,21 @@ func (s *SPVCon) SendCoins(adr btcutil.Address, sendAmt int64) error {
// This is where witness based sighash types need to happen // This is where witness based sighash types need to happen
// sign into stash // sign into stash
sigStash[i], err = txscript.SignatureScript( if ins[i].IsWit {
tx, i, txin.SignatureScript, txscript.SigHashAll, priv, true) sigStash[i], err = txscript.WitnessSignatureScript(
tx, i, ins[i].Value, txin.SignatureScript,
txscript.SigHashAll, priv, true)
if err != nil { if err != nil {
return err return err
} }
} else {
sigStash[i], err = txscript.SignatureScript(
tx, i, txin.SignatureScript,
txscript.SigHashAll, priv, true)
if err != nil {
return err
}
}
} }
// swap sigs into sigScripts in txins // swap sigs into sigScripts in txins
for i, txin := range tx.TxIn { for i, txin := range tx.TxIn {