diff --git a/client/core/account.go b/client/core/account.go index 167908b13f..0ec2051a95 100644 --- a/client/core/account.go +++ b/client/core/account.go @@ -71,6 +71,10 @@ func (c *Core) ToggleAccountStatus(pw []byte, addr string, disable bool) error { if dc.hasActiveOrders() { return fmt.Errorf("cannot disable account with active orders") } + + if dc.hasUnspentBond() { + c.log.Warnf("Disabling dex server with unspent bonds. Bonds will be refunded when expired.") + } } err = c.db.ToggleAccountStatus(addr, disable) diff --git a/client/core/bond.go b/client/core/bond.go index b544d2c5ec..c42f5fe537 100644 --- a/client/core/bond.go +++ b/client/core/bond.go @@ -705,7 +705,7 @@ func (c *Core) rotateBonds(ctx context.Context) { // locked. However, we must refund bonds regardless. bondCfg := c.dexBondConfig(dc, now) - if len(bondCfg.bondAssets) == 0 { + if len(bondCfg.bondAssets) == 0 && !dc.acct.isDisabled() { if !dc.IsDown() && dc.config() != nil { dc.log.Meter("no-bond-assets", time.Minute*10).Warnf("Zero bond assets reported for apparently connected DCRDEX server") } @@ -723,7 +723,7 @@ func (c *Core) rotateBonds(ctx context.Context) { } if dc.acct.isDisabled() { - continue // we can only attempt bond refund(if any) for disabled accounts + continue // For disabled account, we should only bother about unspent bonds that might have been refunded by refundExpiredBonds above. } c.repostPendingBonds(dc, bondCfg, acctBondState, unlocked) diff --git a/client/core/core.go b/client/core/core.go index d5635c8a8f..ba537d10bd 100644 --- a/client/core/core.go +++ b/client/core/core.go @@ -5141,7 +5141,7 @@ func (c *Core) initializeDEXConnections(crypter encrypt.Crypter) { } if dc.acct.isDisabled() { - continue // we can only unlock the dex account to init the account ID. + continue // For disabled account, we only want dc.acct.unlock above to initialize the account ID. } // Unlock the bond wallet if a target tier is set.