From b53286047747a06dd00067b5027beb49bae14543 Mon Sep 17 00:00:00 2001 From: David Hill Date: Wed, 29 Jan 2014 21:21:58 -0500 Subject: [PATCH] sync with btcjson changes to getrawtransaction. ok oga@ --- rpcserver.go | 2 +- util/btcctl/btcctl.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rpcserver.go b/rpcserver.go index fbfbe3e9..b22ae6ef 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -1073,7 +1073,7 @@ func handleGetRawTransaction(s *rpcServer, cmd btcjson.Cmd) (interface{}, error) // When the verbose flag isn't set, simply return the network-serialized // transaction as a hex-encoded string. - if !c.Verbose { + if c.Verbose == 0 { mtxHex, err := messageToHex(mtx) if err != nil { return nil, err diff --git a/util/btcctl/btcctl.go b/util/btcctl/btcctl.go index 0b3106c6..f8ebc98c 100644 --- a/util/btcctl/btcctl.go +++ b/util/btcctl/btcctl.go @@ -69,7 +69,7 @@ var commandHandlers = map[string]*handlerData{ "getnewaddress": &handlerData{0, 1, displayGeneric, nil, makeGetNewAddress, "[account]"}, "getpeerinfo": &handlerData{0, 0, displayJSONDump, nil, makeGetPeerInfo, ""}, "getrawmempool": &handlerData{0, 1, displayJSONDump, []conversionHandler{toBool}, makeGetRawMempool, "[verbose=false]"}, - "getrawtransaction": &handlerData{1, 1, displayJSONDump, []conversionHandler{nil, toBool}, makeGetRawTransaction, " [verbose=false]"}, + "getrawtransaction": &handlerData{1, 1, displayJSONDump, []conversionHandler{nil, toInt}, makeGetRawTransaction, " [verbose=0]"}, "getwork": &handlerData{0, 1, displayJSONDump, nil, makeGetWork, "[jsonrequestobject]"}, "help": &handlerData{0, 1, displayGeneric, nil, makeHelp, "[commandName]"}, "importprivkey": &handlerData{1, 2, displayGeneric, []conversionHandler{nil, nil, toBool}, makeImportPrivKey, " [label] [rescan=true]"}, @@ -411,9 +411,9 @@ func makeHelp(args []interface{}) (btcjson.Cmd, error) { // makeRawTransaction generates the cmd structure for // getrawtransaction commands. func makeGetRawTransaction(args []interface{}) (btcjson.Cmd, error) { - opt := make([]bool, 0, 1) + opt := make([]int, 0, 1) if len(args) > 1 { - opt = append(opt, args[1].(bool)) + opt = append(opt, args[1].(int)) } return btcjson.NewGetRawTransactionCmd("btcctl", args[0].(string), opt...)