From 8f375ba39139c7f64df8c44da0d89fef263f88f0 Mon Sep 17 00:00:00 2001 From: David Hill Date: Fri, 29 Aug 2014 09:32:57 -0400 Subject: [PATCH] Add getnetworkinfo support to btcctl. ok @jrick --- util/btcctl/btcctl.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util/btcctl/btcctl.go b/util/btcctl/btcctl.go index 1483cd91a..0a328fd7c 100644 --- a/util/btcctl/btcctl.go +++ b/util/btcctl/btcctl.go @@ -77,6 +77,7 @@ var commandHandlers = map[string]*handlerData{ "getmininginfo": {0, 0, displayJSONDump, nil, makeGetMiningInfo, ""}, "getnetworkhashps": {0, 2, displayGeneric, []conversionHandler{toInt, toInt}, makeGetNetworkHashPS, "[blocks height]"}, "getnettotals": {0, 0, displayJSONDump, nil, makeGetNetTotals, ""}, + "getnetworkinfo": {0, 0, displayJSONDump, nil, makeGetNetworkInfo, ""}, "getnewaddress": {0, 1, displayGeneric, nil, makeGetNewAddress, "[account]"}, "getpeerinfo": {0, 0, displayJSONDump, nil, makeGetPeerInfo, ""}, "getrawchangeaddress": {0, 0, displayGeneric, nil, makeGetRawChangeAddress, ""}, @@ -452,6 +453,11 @@ func makeGetNetworkHashPS(args []interface{}) (btcjson.Cmd, error) { 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. func makeGetNetTotals(args []interface{}) (btcjson.Cmd, error) { return btcjson.NewGetNetTotalsCmd("btcctl")