tweak keystore

This commit is contained in:
georgehao 2024-06-03 16:32:54 +08:00
parent d4b81f0e08
commit 9d02933c65
No known key found for this signature in database
2 changed files with 5 additions and 2 deletions

View file

@ -220,7 +220,10 @@ func (ac *accountCache) maybeReload() {
ac.watcher.start() ac.watcher.start()
ac.throttle.Reset(minReloadInterval) ac.throttle.Reset(minReloadInterval)
ac.mu.Unlock() ac.mu.Unlock()
ac.scanAccounts() err := ac.scanAccounts()
if err != nil {
log.Debug("failed to scan accounts", "err", err)
}
} }
func (ac *accountCache) close() { func (ac *accountCache) close() {

View file

@ -96,7 +96,7 @@ func (ks *KeyStore) init(keydir string) {
ks.unlocked = make(map[common.Address]*unlocked) ks.unlocked = make(map[common.Address]*unlocked)
ks.cache, ks.changes = newAccountCache(keydir) 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, // to ks. addressCache doesn't keep a reference but unlocked keys do,
// so the finalizer will not trigger until all timed unlocks have expired. // so the finalizer will not trigger until all timed unlocks have expired.
runtime.SetFinalizer(ks, func(m *KeyStore) { runtime.SetFinalizer(ks, func(m *KeyStore) {