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:
parent
e1ce9843bf
commit
649112b764
1 changed files with 6 additions and 0 deletions
|
@ -868,6 +868,9 @@ func WalletLock(frontend chan []byte, icmd btcjson.Cmd) {
|
||||||
}
|
}
|
||||||
ReplySuccess(frontend, icmd.Id(), nil)
|
ReplySuccess(frontend, icmd.Id(), nil)
|
||||||
NotifyWalletLockStateChange("", true)
|
NotifyWalletLockStateChange("", true)
|
||||||
|
} else {
|
||||||
|
ReplyError(frontend, cmd.Id(),
|
||||||
|
&btcjson.ErrWalletInvalidAccountName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -897,6 +900,9 @@ func WalletPassphrase(frontend chan []byte, icmd btcjson.Cmd) {
|
||||||
a.Lock()
|
a.Lock()
|
||||||
NotifyWalletLockStateChange("", true)
|
NotifyWalletLockStateChange("", true)
|
||||||
}()
|
}()
|
||||||
|
} else {
|
||||||
|
ReplyError(frontend, cmd.Id(),
|
||||||
|
&btcjson.ErrWalletInvalidAccountName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue