Update btcctl for latest btcjson changes.

This commit is contained in:
Dave Collins 2014-04-10 20:33:11 -05:00
parent 1fd5cd2742
commit a0bfde8db0

View file

@ -229,20 +229,14 @@ func makeCreateEncryptedWallet(args []interface{}) (btcjson.Cmd, error) {
// makeCreateRawTransaction generates the cmd structure for createrawtransaction // makeCreateRawTransaction generates the cmd structure for createrawtransaction
// commands. // commands.
func makeCreateRawTransaction(args []interface{}) (btcjson.Cmd, error) { func makeCreateRawTransaction(args []interface{}) (btcjson.Cmd, error) {
// First unmarshal the JSON provided by the parameters into interfaces. var inputs []btcjson.TransactionInput
var iinputs, iamounts interface{} err := json.Unmarshal([]byte(args[0].(string)), &inputs)
err := json.Unmarshal([]byte(args[0].(string)), &iinputs)
if err != nil {
return nil, err
}
err = json.Unmarshal([]byte(args[1].(string)), &iamounts)
if err != nil { if err != nil {
return nil, err return nil, err
} }
// Validate and convert the interfaces to concrete types. var amounts map[string]int64
inputs, amounts, err := btcjson.ConvertCreateRawTxParams(iinputs, err = json.Unmarshal([]byte(args[1].(string)), &amounts)
iamounts)
if err != nil { if err != nil {
return nil, err return nil, err
} }