mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 09:50:08 +01:00
add getnewaddress to btcctl
This commit is contained in:
parent
b9a641ab79
commit
221352586b
@ -63,6 +63,7 @@ var commandHandlers = map[string]*handlerData{
|
||||
"getdifficulty": &handlerData{0, 0, displayFloat64, nil, makeGetDifficulty, ""},
|
||||
"getgenerate": &handlerData{0, 0, displayGeneric, nil, makeGetGenerate, ""},
|
||||
"gethashespersec": &handlerData{0, 0, displayGeneric, nil, makeGetHashesPerSec, ""},
|
||||
"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, "<txhash> [verbose=false]"},
|
||||
@ -324,6 +325,15 @@ func makeGetHashesPerSec(args []interface{}) (btcjson.Cmd, error) {
|
||||
return btcjson.NewGetHashesPerSecCmd("btcctl")
|
||||
}
|
||||
|
||||
// makeGetNewAddress generates the cmd structure for getnewaddress commands.
|
||||
func makeGetNewAddress(args []interface{}) (btcjson.Cmd, error) {
|
||||
var account string
|
||||
if len(args) > 0 {
|
||||
account = args[0].(string)
|
||||
}
|
||||
return btcjson.NewGetNewAddressCmd("btcctl", account)
|
||||
}
|
||||
|
||||
// makePeerInfo generates the cmd structure for
|
||||
// getpeerinfo commands.
|
||||
func makeGetPeerInfo(args []interface{}) (btcjson.Cmd, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user