Update for recent btcjson API changes.

This commit is contained in:
Dave Collins 2014-06-16 14:44:36 -05:00
parent 6a69acef21
commit 289efbdea9

View file

@ -680,7 +680,7 @@ func createVinList(mtx *btcwire.MsgTx) ([]btcjson.Vin, error) {
vinList[i].Coinbase = hex.EncodeToString(v.SignatureScript) vinList[i].Coinbase = hex.EncodeToString(v.SignatureScript)
} else { } else {
vinList[i].Txid = v.PreviousOutpoint.Hash.String() vinList[i].Txid = v.PreviousOutpoint.Hash.String()
vinList[i].Vout = int(v.PreviousOutpoint.Index) vinList[i].Vout = v.PreviousOutpoint.Index
disbuf, err := btcscript.DisasmString(v.SignatureScript) disbuf, err := btcscript.DisasmString(v.SignatureScript)
if err != nil { if err != nil {
@ -704,7 +704,7 @@ func createVinList(mtx *btcwire.MsgTx) ([]btcjson.Vin, error) {
func createVoutList(mtx *btcwire.MsgTx, net *btcnet.Params) ([]btcjson.Vout, error) { func createVoutList(mtx *btcwire.MsgTx, net *btcnet.Params) ([]btcjson.Vout, error) {
voutList := make([]btcjson.Vout, len(mtx.TxOut)) voutList := make([]btcjson.Vout, len(mtx.TxOut))
for i, v := range mtx.TxOut { for i, v := range mtx.TxOut {
voutList[i].N = i voutList[i].N = uint32(i)
voutList[i].Value = float64(v.Value) / float64(btcutil.SatoshiPerBitcoin) voutList[i].Value = float64(v.Value) / float64(btcutil.SatoshiPerBitcoin)
disbuf, err := btcscript.DisasmString(v.PkScript) disbuf, err := btcscript.DisasmString(v.PkScript)