Skip to content

Commit

Permalink
client/core: don't panic on reconfigure of disconnected wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
chappjc committed Jan 28, 2021
1 parent 4bed3e2 commit dfe4cd1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,9 @@ func (c *Core) ReconfigureWallet(appPW []byte, assetID uint32, cfg map[string]st

c.wallets[assetID] = wallet

go oldWallet.Disconnect()
if oldWallet.connected() {
go oldWallet.Disconnect()
}

c.notify(newBalanceNote(assetID, balances)) // redundant with wallet config note?
details := fmt.Sprintf("Configuration for %s wallet has been updated. Deposit address = %s", unbip(assetID), wallet.address)
Expand Down Expand Up @@ -3067,8 +3069,7 @@ func (c *Core) initialize() {
continue
}
// Wallet is loaded from the DB, but not yet connected.
c.log.Infof("Loaded %s wallet configuration. Deposit address = %s",
unbip(aid), dbWallet.Address)
c.log.Infof("Loaded %s wallet configuration.", unbip(aid))
c.wallets[dbWallet.AssetID] = wallet
}
numWallets := len(c.wallets)
Expand Down

0 comments on commit dfe4cd1

Please sign in to comment.