From e3eca752daf6a9e75f050f1588765acfa90b3c0c Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Thu, 14 Nov 2013 12:19:20 -0600 Subject: [PATCH] Allow verbose param on btcctl getrawtransaction. --- util/btcctl/btcctl.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/util/btcctl/btcctl.go b/util/btcctl/btcctl.go index 02e2e9f6..d1991cff 100644 --- a/util/btcctl/btcctl.go +++ b/util/btcctl/btcctl.go @@ -60,7 +60,7 @@ var commandHandlers = map[string]*handlerData{ "getpeerinfo": &handlerData{0, 0, displaySpewDump, nil, makeGetPeerInfo, ""}, "getrawmempool": &handlerData{0, 0, displaySpewDump, nil, makeGetRawMempool, ""}, "getrawtransaction": &handlerData{1, 1, displaySpewDump, []conversionHandler{nil, toInt}, makeGetRawTransaction, " [verbose=0]"}, - "verifychain": &handlerData{0, 2, displaySpewDump, []conversionHandler{toInt, toInt}, makeVerifyChain, "[level] [depth]"}, + "verifychain": &handlerData{0, 2, displaySpewDump, []conversionHandler{toInt, toInt}, makeVerifyChain, "[level] [depth]"}, "stop": &handlerData{0, 0, displayGeneric, nil, makeStop, ""}, } @@ -182,7 +182,10 @@ func makeGetRawMempool(args []interface{}) (btcjson.Cmd, error) { // makeRawTransaction generates the cmd structure for // getrawtransaction comands. func makeGetRawTransaction(args []interface{}) (btcjson.Cmd, error) { - i := args[1].(int) + i := 0 + if len(args) > 1 { + i = args[1].(int) + } bi := i != 0 return btcjson.NewGetRawTransactionCmd("btcctl", args[0].(string), bi)