cmd/sweepaccount: fix build errors

This commit is contained in:
Olaoluwa Osuntokun 2018-05-23 17:08:29 -07:00
parent 04036f1c91
commit 8d10315c0c
2 changed files with 5 additions and 3 deletions

View file

@ -12,7 +12,6 @@ import (
"golang.org/x/crypto/ssh/terminal" "golang.org/x/crypto/ssh/terminal"
"github.com/jessevdk/go-flags"
"github.com/btcsuite/btcd/btcjson" "github.com/btcsuite/btcd/btcjson"
"github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/rpcclient" "github.com/btcsuite/btcd/rpcclient"
@ -23,6 +22,7 @@ import (
"github.com/btcsuite/btcwallet/netparams" "github.com/btcsuite/btcwallet/netparams"
"github.com/btcsuite/btcwallet/wallet/txauthor" "github.com/btcsuite/btcwallet/wallet/txauthor"
"github.com/btcsuite/btcwallet/wallet/txrules" "github.com/btcsuite/btcwallet/wallet/txrules"
"github.com/jessevdk/go-flags"
) )
var ( var (
@ -142,6 +142,7 @@ func makeInputSource(outputs []btcjson.ListUnspentResult) txauthor.InputSource {
var ( var (
totalInputValue btcutil.Amount totalInputValue btcutil.Amount
inputs = make([]*wire.TxIn, 0, len(outputs)) inputs = make([]*wire.TxIn, 0, len(outputs))
inputValues = make([]btcutil.Amount, 0, len(outputs))
sourceErr error sourceErr error
) )
for _, output := range outputs { for _, output := range outputs {
@ -172,14 +173,15 @@ func makeInputSource(outputs []btcjson.ListUnspentResult) txauthor.InputSource {
} }
inputs = append(inputs, wire.NewTxIn(&previousOutPoint, nil, nil)) inputs = append(inputs, wire.NewTxIn(&previousOutPoint, nil, nil))
inputValues = append(inputValues, outputAmount)
} }
if sourceErr == nil && totalInputValue == 0 { if sourceErr == nil && totalInputValue == 0 {
sourceErr = noInputValue{} sourceErr = noInputValue{}
} }
return func(btcutil.Amount) (btcutil.Amount, []*wire.TxIn, [][]byte, error) { return func(btcutil.Amount) (btcutil.Amount, []*wire.TxIn, []btcutil.Amount, [][]byte, error) {
return totalInputValue, inputs, nil, sourceErr return totalInputValue, inputs, inputValues, nil, sourceErr
} }
} }

BIN
cmd/sweepaccount/sweepaccount Executable file

Binary file not shown.