From 649112b7644821816fccd5e8a6ba673d2a41e1cc Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Thu, 21 Nov 2013 11:06:46 -0500 Subject: [PATCH] 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. --- cmdmgr.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmdmgr.go b/cmdmgr.go index d34ef19..627462c 100644 --- a/cmdmgr.go +++ b/cmdmgr.go @@ -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) } }