diff --git a/util/btcctl/btcctl.go b/util/btcctl/btcctl.go index 93d77d65..b4a0677a 100644 --- a/util/btcctl/btcctl.go +++ b/util/btcctl/btcctl.go @@ -99,6 +99,7 @@ var commandHandlers = map[string]*handlerData{ "sendmany": {2, 2, displayGeneric, []conversionHandler{nil, nil, toInt, nil}, makeSendMany, " <{\"address\":amount,...}> [minconf=1] [comment]"}, "sendrawtransaction": {1, 0, displayGeneric, nil, makeSendRawTransaction, ""}, "sendtoaddress": {2, 2, displayGeneric, []conversionHandler{nil, toSatoshi, nil, nil}, makeSendToAddress, "
[comment] [comment-to]"}, + "setgenerate": {1, 1, displayGeneric, []conversionHandler{toBool, toInt}, makeSetGenerate, " [genproclimit]"}, "settxfee": {1, 0, displayGeneric, []conversionHandler{toSatoshi}, makeSetTxFee, ""}, "signmessage": {2, 2, displayGeneric, nil, makeSignMessage, "
"}, "stop": {0, 0, displayGeneric, nil, makeStop, ""}, @@ -696,6 +697,15 @@ func makeSendToAddress(args []interface{}) (btcjson.Cmd, error) { return btcjson.NewSendToAddressCmd("btcctl", args[0].(string), args[1].(int64), args[2:]...) } +// makeSetGenerate generates the cmd structure for setgenerate commands. +func makeSetGenerate(args []interface{}) (btcjson.Cmd, error) { + var optargs = make([]int, 0, 1) + if len(args) > 1 { + optargs = append(optargs, args[1].(int)) + } + return btcjson.NewSetGenerateCmd("btcctl", args[0].(bool), optargs...) +} + // makeSetTxFee generates the cmd structure for settxfee commands. func makeSetTxFee(args []interface{}) (btcjson.Cmd, error) { return btcjson.NewSetTxFeeCmd("btcctl", args[0].(int64))