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?
|
// Does this wallet already exist?
|
||||||
wallets.Lock()
|
wallets.Lock()
|
||||||
|
defer wallets.Unlock()
|
||||||
if w := wallets.m[wname]; w != nil {
|
if w := wallets.m[wname]; w != nil {
|
||||||
e := WalletInvalidAccountName
|
e := WalletInvalidAccountName
|
||||||
e.Message = "Wallet already exists."
|
e.Message = "Wallet already exists."
|
||||||
ReplyError(reply, msg.Id, &e)
|
ReplyError(reply, msg.Id, &e)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer wallets.Unlock()
|
|
||||||
|
|
||||||
var net btcwire.BitcoinNet
|
var net btcwire.BitcoinNet
|
||||||
if cfg.MainNet {
|
if cfg.MainNet {
|
||||||
|
|
Loading…
Reference in a new issue