Skip to content

Commit 4bed3e2

Browse files
committed
client/core: avoid potential wallet reconfigure deadlock
1 parent bca1325 commit 4bed3e2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ node_modules/
2121
client/cmd/dexc/dexc
2222
client/cmd/dexcctl/dexcctl
2323
wiki
24+
bin/

client/core/core.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,7 @@ func (c *Core) loadWallet(dbWallet *db.Wallet) (*xcWallet, error) {
14301430
walletCfg := &asset.WalletConfig{
14311431
Settings: dbWallet.Settings,
14321432
TipChange: func(err error) {
1433-
c.tipChange(assetID, err)
1433+
go c.tipChange(assetID, err)
14341434
},
14351435
}
14361436
logger := c.log.SubLogger(unbip(assetID))
@@ -1625,11 +1625,10 @@ func (c *Core) ReconfigureWallet(appPW []byte, assetID uint32, cfg map[string]st
16251625
}
16261626
c.connMtx.RUnlock()
16271627

1628-
if oldWallet.connected() {
1629-
oldWallet.Disconnect()
1630-
}
16311628
c.wallets[assetID] = wallet
16321629

1630+
go oldWallet.Disconnect()
1631+
16331632
c.notify(newBalanceNote(assetID, balances)) // redundant with wallet config note?
16341633
details := fmt.Sprintf("Configuration for %s wallet has been updated. Deposit address = %s", unbip(assetID), wallet.address)
16351634
c.notify(newWalletConfigNote("Wallet Configuration Updated", details, db.Success, wallet.state()))

0 commit comments

Comments
 (0)