Add gettransaction to btcctl.

This commit is contained in:
Owain G. Ainsworth 2014-02-04 00:42:44 +00:00
parent 1716136f62
commit 75b59ef6e4

View file

@ -74,6 +74,7 @@ var commandHandlers = map[string]*handlerData{
"getrawtransaction": {1, 1, displayJSONDump, []conversionHandler{nil, toInt}, makeGetRawTransaction, "<txhash> [verbose=0]"}, "getrawtransaction": {1, 1, displayJSONDump, []conversionHandler{nil, toInt}, makeGetRawTransaction, "<txhash> [verbose=0]"},
"getreceivedbyaccount": {1, 1, displayGeneric, []conversionHandler{nil, toInt}, makeGetReceivedByAccount, "<account> [minconf=1]"}, "getreceivedbyaccount": {1, 1, displayGeneric, []conversionHandler{nil, toInt}, makeGetReceivedByAccount, "<account> [minconf=1]"},
"getreceivedbyaddress": {1, 1, displayGeneric, []conversionHandler{nil, toInt}, makeGetReceivedByAddress, "<address> [minconf=1]"}, "getreceivedbyaddress": {1, 1, displayGeneric, []conversionHandler{nil, toInt}, makeGetReceivedByAddress, "<address> [minconf=1]"},
"gettransaction": {1, 1, displayJSONDump, nil, makeGetTransaction, "txid"},
"gettxoutsetinfo": {0, 0, displayJSONDump, nil, makeGetTxOutSetInfo, ""}, "gettxoutsetinfo": {0, 0, displayJSONDump, nil, makeGetTxOutSetInfo, ""},
"getwork": {0, 1, displayJSONDump, nil, makeGetWork, "[jsonrequestobject]"}, "getwork": {0, 1, displayJSONDump, nil, makeGetWork, "[jsonrequestobject]"},
"help": {0, 1, displayGeneric, nil, makeHelp, "[commandName]"}, "help": {0, 1, displayGeneric, nil, makeHelp, "[commandName]"},
@ -429,6 +430,11 @@ func makeGetReceivedByAddress(args []interface{}) (btcjson.Cmd, error) {
return btcjson.NewGetReceivedByAddressCmd("btcctl", args[0].(string), opt...) return btcjson.NewGetReceivedByAddressCmd("btcctl", args[0].(string), opt...)
} }
// makeGetTransaction generates the cmd structure for gettransaction commands.
func makeGetTransaction(args []interface{}) (btcjson.Cmd, error) {
return btcjson.NewGetTransactionCmd("btcctl", args[0].(string))
}
// makeGetTxOutSetInfo generates the cmd structure for gettxoutsetinfo commands. // makeGetTxOutSetInfo generates the cmd structure for gettxoutsetinfo commands.
func makeGetTxOutSetInfo(args []interface{}) (btcjson.Cmd, error) { func makeGetTxOutSetInfo(args []interface{}) (btcjson.Cmd, error) {
return btcjson.NewGetTxOutSetInfoCmd("btcctl") return btcjson.NewGetTxOutSetInfoCmd("btcctl")