Add getnetworkinfo support to btcctl.

ok @jrick
This commit is contained in:
David Hill 2014-08-29 09:32:57 -04:00
parent 8774a77d33
commit 8f375ba391

View file

@ -77,6 +77,7 @@ var commandHandlers = map[string]*handlerData{
"getmininginfo": {0, 0, displayJSONDump, nil, makeGetMiningInfo, ""}, "getmininginfo": {0, 0, displayJSONDump, nil, makeGetMiningInfo, ""},
"getnetworkhashps": {0, 2, displayGeneric, []conversionHandler{toInt, toInt}, makeGetNetworkHashPS, "[blocks height]"}, "getnetworkhashps": {0, 2, displayGeneric, []conversionHandler{toInt, toInt}, makeGetNetworkHashPS, "[blocks height]"},
"getnettotals": {0, 0, displayJSONDump, nil, makeGetNetTotals, ""}, "getnettotals": {0, 0, displayJSONDump, nil, makeGetNetTotals, ""},
"getnetworkinfo": {0, 0, displayJSONDump, nil, makeGetNetworkInfo, ""},
"getnewaddress": {0, 1, displayGeneric, nil, makeGetNewAddress, "[account]"}, "getnewaddress": {0, 1, displayGeneric, nil, makeGetNewAddress, "[account]"},
"getpeerinfo": {0, 0, displayJSONDump, nil, makeGetPeerInfo, ""}, "getpeerinfo": {0, 0, displayJSONDump, nil, makeGetPeerInfo, ""},
"getrawchangeaddress": {0, 0, displayGeneric, nil, makeGetRawChangeAddress, ""}, "getrawchangeaddress": {0, 0, displayGeneric, nil, makeGetRawChangeAddress, ""},
@ -452,6 +453,11 @@ func makeGetNetworkHashPS(args []interface{}) (btcjson.Cmd, error) {
return cmd, nil return cmd, nil
} }
// makeGetNetworkInfo generates the cmd structure for getnetworkinfo commands.
func makeGetNetworkInfo(args []interface{}) (btcjson.Cmd, error) {
return btcjson.NewGetNetworkInfoCmd("btcctl")
}
// makeGetNetTotals generates the cmd structure for getnettotals commands. // makeGetNetTotals generates the cmd structure for getnettotals commands.
func makeGetNetTotals(args []interface{}) (btcjson.Cmd, error) { func makeGetNetTotals(args []interface{}) (btcjson.Cmd, error) {
return btcjson.NewGetNetTotalsCmd("btcctl") return btcjson.NewGetNetTotalsCmd("btcctl")