From f67358d4dbaef9cf548149e5d5be47a3d8543218 Mon Sep 17 00:00:00 2001 From: David Hill Date: Wed, 11 Jun 2014 11:12:27 -0400 Subject: [PATCH] Add estimatefee and estimatepriority to btcctl. --- util/btcctl/btcctl.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/util/btcctl/btcctl.go b/util/btcctl/btcctl.go index b4a0677a..17d34818 100644 --- a/util/btcctl/btcctl.go +++ b/util/btcctl/btcctl.go @@ -53,6 +53,8 @@ var commandHandlers = map[string]*handlerData{ "decoderawtransaction": {1, 0, displayJSONDump, nil, makeDecodeRawTransaction, ""}, "decodescript": {1, 0, displayJSONDump, nil, makeDecodeScript, ""}, "dumpprivkey": {1, 0, displayGeneric, nil, makeDumpPrivKey, ""}, + "estimatefee": {1, 0, displayGeneric, []conversionHandler{toInt64}, makeEstimateFee, ""}, + "estimatepriority": {1, 0, displayGeneric, []conversionHandler{toInt64}, makeEstimatePriority, ""}, "getaccount": {1, 0, displayGeneric, nil, makeGetAccount, "
"}, "getaccountaddress": {1, 0, displayGeneric, nil, makeGetAccountAddress, ""}, "getaddednodeinfo": {1, 1, displayJSONDump, []conversionHandler{toBool, nil}, makeGetAddedNodeInfo, " [node]"}, @@ -267,6 +269,16 @@ func makeDumpPrivKey(args []interface{}) (btcjson.Cmd, error) { return btcjson.NewDumpPrivKeyCmd("btcctl", args[0].(string)) } +// makeEstimateFee generates the cmd structure for estimatefee commands. +func makeEstimateFee(args []interface{}) (btcjson.Cmd, error) { + return btcjson.NewEstimateFeeCmd("btcctl", args[0].(int64)) +} + +// makeEstimatePriority generates the cmd structure for estimatepriority commands. +func makeEstimatePriority(args []interface{}) (btcjson.Cmd, error) { + return btcjson.NewEstimatePriorityCmd("btcctl", args[0].(int64)) +} + // makeGetAccount generates the cmd structure for // getaccount commands. func makeGetAccount(args []interface{}) (btcjson.Cmd, error) {