From 13868e76ec43530bf1bd9271e426e09894ab29c1 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 30 Dec 2013 16:31:47 -0500 Subject: [PATCH] Add getaccount support to btcctl. --- util/btcctl/btcctl.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/btcctl/btcctl.go b/util/btcctl/btcctl.go index 250d8700..4331af3b 100644 --- a/util/btcctl/btcctl.go +++ b/util/btcctl/btcctl.go @@ -48,6 +48,7 @@ var commandHandlers = map[string]*handlerData{ "debuglevel": &handlerData{1, 0, displayGeneric, nil, makeDebugLevel, ""}, "decoderawtransaction": &handlerData{1, 0, displayJSONDump, nil, makeDecodeRawTransaction, ""}, "dumpprivkey": &handlerData{1, 0, displayGeneric, nil, makeDumpPrivKey, ""}, + "getaccount": &handlerData{1, 0, displayGeneric, nil, makeGetAccount, "
"}, "getbalance": &handlerData{0, 2, displayGeneric, []conversionHandler{nil, toInt}, makeGetBalance, "[account] [minconf=1]"}, "getbestblockhash": &handlerData{0, 0, displayGeneric, nil, makeGetBestBlockHash, ""}, "getblock": &handlerData{1, 2, displayJSONDump, []conversionHandler{nil, toBool, toBool}, makeGetBlock, ""}, @@ -166,6 +167,12 @@ func makeDumpPrivKey(args []interface{}) (btcjson.Cmd, error) { return btcjson.NewDumpPrivKeyCmd("btcctl", args[0].(string)) } +// makeGetAccount generates the cmd structure for +// getaddress commands. +func makeGetAccount(args []interface{}) (btcjson.Cmd, error) { + return btcjson.NewGetAccountCmd("btcctl", args[0].(string)) +} + // makeGetBalance generates the cmd structure for // getbalance commands. func makeGetBalance(args []interface{}) (btcjson.Cmd, error) {