Add gethashespersec command to btcctl.

This commit is contained in:
Dave Collins 2013-12-25 19:13:14 -06:00
parent 195ada0979
commit 23ff70d682

View file

@ -55,6 +55,7 @@ var commandHandlers = map[string]*handlerData{
"getconnectioncount": &handlerData{0, 0, displayFloat64, nil, makeGetConnectionCount, ""}, "getconnectioncount": &handlerData{0, 0, displayFloat64, nil, makeGetConnectionCount, ""},
"getdifficulty": &handlerData{0, 0, displayFloat64, nil, makeGetDifficulty, ""}, "getdifficulty": &handlerData{0, 0, displayFloat64, nil, makeGetDifficulty, ""},
"getgenerate": &handlerData{0, 0, displayGeneric, nil, makeGetGenerate, ""}, "getgenerate": &handlerData{0, 0, displayGeneric, nil, makeGetGenerate, ""},
"gethashespersec": &handlerData{0, 0, displayGeneric, nil, makeGetHashesPerSec, ""},
"getpeerinfo": &handlerData{0, 0, displaySpewDump, nil, makeGetPeerInfo, ""}, "getpeerinfo": &handlerData{0, 0, displaySpewDump, nil, makeGetPeerInfo, ""},
"getrawmempool": &handlerData{0, 1, displaySpewDump, []conversionHandler{toBool}, makeGetRawMempool, "[verbose=false]"}, "getrawmempool": &handlerData{0, 1, displaySpewDump, []conversionHandler{toBool}, makeGetRawMempool, "[verbose=false]"},
"getrawtransaction": &handlerData{1, 1, displaySpewDump, []conversionHandler{nil, toBool}, makeGetRawTransaction, "<txhash> [verbose=false]"}, "getrawtransaction": &handlerData{1, 1, displaySpewDump, []conversionHandler{nil, toBool}, makeGetRawTransaction, "<txhash> [verbose=false]"},
@ -200,6 +201,11 @@ func makeGetGenerate(args []interface{}) (btcjson.Cmd, error) {
return btcjson.NewGetGenerateCmd("btcctl") return btcjson.NewGetGenerateCmd("btcctl")
} }
// makeGetHashesPerSec generates the cmd structure for gethashespersec comands.
func makeGetHashesPerSec(args []interface{}) (btcjson.Cmd, error) {
return btcjson.NewGetHashesPerSecCmd("btcctl")
}
// makePeerInfo generates the cmd structure for // makePeerInfo generates the cmd structure for
// getpeerinfo comands. // getpeerinfo comands.
func makeGetPeerInfo(args []interface{}) (btcjson.Cmd, error) { func makeGetPeerInfo(args []interface{}) (btcjson.Cmd, error) {