Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions client/asset/dcr/rpcwallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,19 @@ func (w *rpcWallet) LockAccount(ctx context.Context, acctName string) error {
return translateRPCCancelErr(err)
}

// UnlockAccount unlocks the specified account.
// Part of the Wallet interface.
// UnlockAccount unlocks the specified account or the wallet if account is not
// encrypted. Part of the Wallet interface.
func (w *rpcWallet) UnlockAccount(ctx context.Context, pw []byte, acctName string) error {
return translateRPCCancelErr(w.rpcClient.UnlockAccount(ctx, acctName, string(pw)))
var res *walletjson.AccountUnlockedResult
res, err := w.rpcClient.AccountUnlocked(ctx, acctName)
if err != nil {
return err
}
if res.Encrypted {
return translateRPCCancelErr(w.rpcClient.UnlockAccount(ctx, acctName, string(pw)))
Comment on lines +699 to +700
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for restoring this logic. I suppose it makes sense to restore it down here in the rpcWallet code instead of up at the ExchangeWallet level where it was.

Also, I can confirm that (*rpcWallet).LockAccount does have this accountunlocked check.

}
return w.unlockWallet(ctx, string(pw), 0)

}

// SyncStatus returns the wallet's sync status.
Expand Down