Add walletpassphrasechange support to btcctl.
This commit is contained in:
parent
ffe767c679
commit
36e5aa8e92
1 changed files with 42 additions and 34 deletions
|
@ -78,6 +78,7 @@ var commandHandlers = map[string]*handlerData{
|
|||
"submitblock": &handlerData{1, 1, displayGeneric, nil, makeSubmitBlock, "<hexdata> [jsonparametersobject]"},
|
||||
"verifychain": &handlerData{0, 2, displayJSONDump, []conversionHandler{toInt, toInt}, makeVerifyChain, "[level] [numblocks]"},
|
||||
"walletpassphrase": &handlerData{1, 1, displayGeneric, []conversionHandler{nil, toInt64}, makeWalletPassphrase, "<passphrase> [timeout]"},
|
||||
"walletpassphrasechange": &handlerData{2, 0, displayGeneric, nil, makeWalletPassphraseChange, "<oldpassphrase> <newpassphrase>"},
|
||||
}
|
||||
|
||||
// toInt attempts to convert the passed string to an integer. It returns the
|
||||
|
@ -466,6 +467,13 @@ func makeWalletPassphrase(args []interface{}) (btcjson.Cmd, error) {
|
|||
return btcjson.NewWalletPassphraseCmd("btcctl", args[0].(string), timeout)
|
||||
}
|
||||
|
||||
// makeWalletPassphraseChange generates the cmd structure for
|
||||
// walletpassphrasechange commands.
|
||||
func makeWalletPassphraseChange(args []interface{}) (btcjson.Cmd, error) {
|
||||
return btcjson.NewWalletPassphraseChangeCmd("btcctl", args[0].(string),
|
||||
args[1].(string))
|
||||
}
|
||||
|
||||
// send sends a JSON-RPC command to the specified RPC server and examines the
|
||||
// results for various error conditions. It either returns a valid result or
|
||||
// an appropriate error.
|
||||
|
|
Loading…
Reference in a new issue