From 4cb1500a0b8acb2fa7b75efd0fe714eefd533da6 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Fri, 3 Jan 2014 23:30:08 -0600 Subject: [PATCH] Add decodescript support to btcctl. --- util/btcctl/btcctl.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util/btcctl/btcctl.go b/util/btcctl/btcctl.go index a41a35c59..55b373426 100644 --- a/util/btcctl/btcctl.go +++ b/util/btcctl/btcctl.go @@ -48,6 +48,7 @@ var commandHandlers = map[string]*handlerData{ "createrawtransaction": &handlerData{2, 0, displayGeneric, nil, makeCreateRawTransaction, "\"[{\"txid\":\"id\",\"vout\":n},...]\" \"{\"address\":amount,...}\""}, "debuglevel": &handlerData{1, 0, displayGeneric, nil, makeDebugLevel, ""}, "decoderawtransaction": &handlerData{1, 0, displayJSONDump, nil, makeDecodeRawTransaction, ""}, + "decodescript": &handlerData{1, 0, displayJSONDump, nil, makeDecodeScript, ""}, "dumpprivkey": &handlerData{1, 0, displayGeneric, nil, makeDumpPrivKey, ""}, "getaccount": &handlerData{1, 0, displayGeneric, nil, makeGetAccount, "
"}, "getaccountaddress": &handlerData{1, 0, displayGeneric, nil, makeGetAccountAddress, ""}, @@ -187,6 +188,11 @@ func makeDecodeRawTransaction(args []interface{}) (btcjson.Cmd, error) { return btcjson.NewDecodeRawTransactionCmd("btcctl", args[0].(string)) } +// makeDecodeScript generates the cmd structure for decodescript comands. +func makeDecodeScript(args []interface{}) (btcjson.Cmd, error) { + return btcjson.NewDecodeScriptCmd("btcctl", args[0].(string)) +} + // makeDumpPrivKey generates the cmd structure for // dumpprivkey commands. func makeDumpPrivKey(args []interface{}) (btcjson.Cmd, error) {