Update btcctl getwork for latest btcjson changes.

This commit is contained in:
Dave Collins 2014-02-11 16:29:54 -06:00
parent 1d60e5dba5
commit db87b9e85f

View file

@ -77,7 +77,7 @@ var commandHandlers = map[string]*handlerData{
"getreceivedbyaddress": {1, 1, displayGeneric, []conversionHandler{nil, toInt}, makeGetReceivedByAddress, "<address> [minconf=1]"}, "getreceivedbyaddress": {1, 1, displayGeneric, []conversionHandler{nil, toInt}, makeGetReceivedByAddress, "<address> [minconf=1]"},
"gettransaction": {1, 1, displayJSONDump, nil, makeGetTransaction, "txid"}, "gettransaction": {1, 1, displayJSONDump, nil, makeGetTransaction, "txid"},
"gettxoutsetinfo": {0, 0, displayJSONDump, nil, makeGetTxOutSetInfo, ""}, "gettxoutsetinfo": {0, 0, displayJSONDump, nil, makeGetTxOutSetInfo, ""},
"getwork": {0, 1, displayJSONDump, nil, makeGetWork, "[jsonrequestobject]"}, "getwork": {0, 1, displayJSONDump, nil, makeGetWork, "[data]"},
"help": {0, 1, displayGeneric, nil, makeHelp, "[commandName]"}, "help": {0, 1, displayGeneric, nil, makeHelp, "[commandName]"},
"importprivkey": {1, 2, displayGeneric, []conversionHandler{nil, nil, toBool}, makeImportPrivKey, "<wifprivkey> [label] [rescan=true]"}, "importprivkey": {1, 2, displayGeneric, []conversionHandler{nil, nil, toBool}, makeImportPrivKey, "<wifprivkey> [label] [rescan=true]"},
"keypoolrefill": {0, 1, displayGeneric, []conversionHandler{toInt}, makeKeyPoolRefill, "[newsize]"}, "keypoolrefill": {0, 1, displayGeneric, []conversionHandler{toInt}, makeKeyPoolRefill, "[newsize]"},
@ -470,10 +470,7 @@ func makeGetWork(args []interface{}) (btcjson.Cmd, error) {
return nil, err return nil, err
} }
if len(args) == 1 { if len(args) == 1 {
err = cmd.UnmarshalJSON([]byte(args[0].(string))) cmd.Data = args[0].(string)
if err != nil {
return nil, err
}
} }
return cmd, nil return cmd, nil
} }