Reply with errors if the expected account does not exist.

This fixes the cases for the walletlock and walletpassphase requests
to return an appropiate error to the frontend when the default account
does not exist.
This commit is contained in:
Josh Rickmar 2013-11-21 11:06:46 -05:00
parent e1ce9843bf
commit 649112b764

View file

@ -868,6 +868,9 @@ func WalletLock(frontend chan []byte, icmd btcjson.Cmd) {
}
ReplySuccess(frontend, icmd.Id(), nil)
NotifyWalletLockStateChange("", true)
} else {
ReplyError(frontend, cmd.Id(),
&btcjson.ErrWalletInvalidAccountName)
}
}
@ -897,6 +900,9 @@ func WalletPassphrase(frontend chan []byte, icmd btcjson.Cmd) {
a.Lock()
NotifyWalletLockStateChange("", true)
}()
} else {
ReplyError(frontend, cmd.Id(),
&btcjson.ErrWalletInvalidAccountName)
}
}