diff --git a/util/btcctl/btcctl.go b/util/btcctl/btcctl.go index 5a7dba84..eaf58b57 100644 --- a/util/btcctl/btcctl.go +++ b/util/btcctl/btcctl.go @@ -46,6 +46,7 @@ var ( // commandHandlers is a map of commands and associated handler data that is used // to validate correctness and perform the command. var commandHandlers = map[string]*handlerData{ + "addmultisigaddress": {2, 1, displayGeneric, []conversionHandler{toInt, nil, nil}, makeAddMultiSigAddress, " <[\"pubkey\",...]> [account]"}, "addnode": {2, 0, displayJSONDump, nil, makeAddNode, " "}, "createencryptedwallet": {1, 0, displayGeneric, nil, makeCreateEncryptedWallet, ""}, "createrawtransaction": {2, 0, displayGeneric, nil, makeCreateRawTransaction, "\"[{\"txid\":\"id\",\"vout\":n},...]\" \"{\"address\":amount,...}\""}, @@ -199,6 +200,20 @@ func displayJSONDump(reply interface{}) error { return nil } +// makeAddMultiSigAddress generates the cmd structure for addmultisigaddress commands. +func makeAddMultiSigAddress(args []interface{}) (btcjson.Cmd, error) { + var pubkeys []string + err := json.Unmarshal([]byte(args[1].(string)), &pubkeys) + if err != nil { + return nil, err + } + var opt string + if len(args) > 2 { + opt = args[2].(string) + } + return btcjson.NewAddMultisigAddressCmd("btcctl", args[0].(int), pubkeys, opt) +} + // makeAddNode generates the cmd structure for addnode commands. func makeAddNode(args []interface{}) (btcjson.Cmd, error) { return btcjson.NewAddNodeCmd("btcctl", args[0].(string),