add walletlock to btcctl

This commit is contained in:
David Hill 2014-01-27 13:44:31 -05:00
parent 36e5aa8e92
commit a5e5903caf

View file

@ -77,6 +77,7 @@ var commandHandlers = map[string]*handlerData{
"stop": &handlerData{0, 0, displayGeneric, nil, makeStop, ""},
"submitblock": &handlerData{1, 1, displayGeneric, nil, makeSubmitBlock, "<hexdata> [jsonparametersobject]"},
"verifychain": &handlerData{0, 2, displayJSONDump, []conversionHandler{toInt, toInt}, makeVerifyChain, "[level] [numblocks]"},
"walletlock": &handlerData{0, 0, displayGeneric, nil, makeWalletLock, ""},
"walletpassphrase": &handlerData{1, 1, displayGeneric, []conversionHandler{nil, toInt64}, makeWalletPassphrase, "<passphrase> [timeout]"},
"walletpassphrasechange": &handlerData{2, 0, displayGeneric, nil, makeWalletPassphraseChange, "<oldpassphrase> <newpassphrase>"},
}
@ -458,6 +459,11 @@ func makeVerifyChain(args []interface{}) (btcjson.Cmd, error) {
return btcjson.NewVerifyChainCmd("btcctl", iargs...)
}
// makeWalletLock generates the cmd structure for walletlock commands.
func makeWalletLock(args []interface{}) (btcjson.Cmd, error) {
return btcjson.NewWalletLockCmd("btcctl")
}
// makeWalletPassphrase generates the cmd structure for walletpassphrase commands.
func makeWalletPassphrase(args []interface{}) (btcjson.Cmd, error) {
timeout := int64(60)