From 9d02933c65dc24cade1f705f814646a025c84fcb Mon Sep 17 00:00:00 2001 From: georgehao Date: Mon, 3 Jun 2024 16:32:54 +0800 Subject: [PATCH] tweak keystore --- accounts/keystore/account_cache.go | 5 ++++- accounts/keystore/keystore.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index f7cf688e62..8b0ad176b7 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -220,7 +220,10 @@ func (ac *accountCache) maybeReload() { ac.watcher.start() ac.throttle.Reset(minReloadInterval) ac.mu.Unlock() - ac.scanAccounts() + err := ac.scanAccounts() + if err != nil { + log.Debug("failed to scan accounts", "err", err) + } } func (ac *accountCache) close() { diff --git a/accounts/keystore/keystore.go b/accounts/keystore/keystore.go index df3dda60b6..8a7ed4a4e1 100644 --- a/accounts/keystore/keystore.go +++ b/accounts/keystore/keystore.go @@ -96,7 +96,7 @@ func (ks *KeyStore) init(keydir string) { ks.unlocked = make(map[common.Address]*unlocked) ks.cache, ks.changes = newAccountCache(keydir) - // TODO: In order for this finalizer to work, there must be no references + // NOTE: In order for this finalizer to work, there must be no references // to ks. addressCache doesn't keep a reference but unlocked keys do, // so the finalizer will not trigger until all timed unlocks have expired. runtime.SetFinalizer(ks, func(m *KeyStore) {