Skip to content

Commit

Permalink
allAccounts for Locked() too
Browse files Browse the repository at this point in the history
For (*xcWallet).refreshUnlock and (*xcWallet).unlocked, the Unlocked
backend check needs to consider all accounts too.
  • Loading branch information
chappjc committed Nov 10, 2022
1 parent d1c2e9a commit ac6461f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions client/asset/dcr/dcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -782,10 +782,8 @@ func (dcr *ExchangeWallet) Connect(ctx context.Context) (*sync.WaitGroup, error)
}
}()

cfg := dcr.config()

// Validate accounts early on to prevent errors later.
for _, acct := range []string{cfg.primaryAcct, cfg.unmixedAccount, cfg.tradingAccount} {
for _, acct := range dcr.allAccounts() {
if acct == "" {
continue
}
Expand Down Expand Up @@ -3065,7 +3063,7 @@ func (dcr *ExchangeWallet) Lock() error {
// Locked will be true if the wallet is currently locked.
// Q: why are we ignoring RPC errors in this?
func (dcr *ExchangeWallet) Locked() bool {
for _, acct := range dcr.fundingAccounts() {
for _, acct := range dcr.allAccounts() {
unlocked, err := dcr.wallet.AccountUnlocked(dcr.ctx, acct)
if err != nil {
dcr.log.Errorf("error checking account lock status %v", err)
Expand Down

0 comments on commit ac6461f

Please sign in to comment.