Move defered Unlock() before a possible function return.
This commit is contained in:
parent
1d42efafad
commit
b3d8f02395
1 changed files with 1 additions and 1 deletions
|
@ -752,13 +752,13 @@ func CreateEncryptedWallet(reply chan []byte, msg *btcjson.Message) {
|
|||
|
||||
// Does this wallet already exist?
|
||||
wallets.Lock()
|
||||
defer wallets.Unlock()
|
||||
if w := wallets.m[wname]; w != nil {
|
||||
e := WalletInvalidAccountName
|
||||
e.Message = "Wallet already exists."
|
||||
ReplyError(reply, msg.Id, &e)
|
||||
return
|
||||
}
|
||||
defer wallets.Unlock()
|
||||
|
||||
var net btcwire.BitcoinNet
|
||||
if cfg.MainNet {
|
||||
|
|
Loading…
Reference in a new issue