From d34ca5c59d0ae38b6c247089e372ab04d30ac47e Mon Sep 17 00:00:00 2001 From: Roy Lee Date: Sat, 17 Sep 2022 13:21:45 -0700 Subject: [PATCH] wallet: unblock Lock() when the wallet is shutdown --- wallet/wallet.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wallet/wallet.go b/wallet/wallet.go index 913440b..51b738e 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -1379,7 +1379,10 @@ func (w *Wallet) Unlock(passphrase []byte, lock <-chan time.Time) error { // Lock locks the wallet's address manager. func (w *Wallet) Lock() { - w.lockRequests <- struct{}{} + select { + case <-w.quitChan(): + case w.lockRequests <- struct{}{}: + } } // Locked returns whether the account manager for a wallet is locked. -- 2.45.2