diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index 9881f7712c..f19e6512a7 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -228,6 +228,7 @@ func (ac *accountCache) close() { ac.mu.Unlock() } +// readAccount is a helper-function to read an encrypted keyfile func readAccount(path string, buf *bufio.Reader) *accounts.Account { var key struct { @@ -298,7 +299,6 @@ func (ac *accountCache) checkFile(path string) error { // scanAccounts checks if any changes have occurred on the filesystem, and // updates the account cache accordingly - func (ac *accountCache) scanAccounts() error { // Scan the entire folder metadata for file changes creates, deletes, updates, err := ac.fileC.scan(ac.keydir) diff --git a/accounts/keystore/account_cache_test.go b/accounts/keystore/account_cache_test.go index 47538b10d9..650ad4a74d 100644 --- a/accounts/keystore/account_cache_test.go +++ b/accounts/keystore/account_cache_test.go @@ -376,8 +376,7 @@ func TestUpdatedKeyfileContents(t *testing.T) { return } - // needed so that modTime of `file` is different to its current value after forceCopyFile - time.Sleep(1000 * time.Millisecond) + time.Sleep(200 * time.Millisecond) // Now replace file contents if err := forceCopyFile(file, cachetestAccounts[1].URL.Path); err != nil { @@ -392,8 +391,7 @@ func TestUpdatedKeyfileContents(t *testing.T) { return } - // needed so that modTime of `file` is different to its current value after forceCopyFile - time.Sleep(1000 * time.Millisecond) + time.Sleep(200 * time.Millisecond) // Now replace file contents again if err := forceCopyFile(file, cachetestAccounts[2].URL.Path); err != nil { @@ -408,8 +406,7 @@ func TestUpdatedKeyfileContents(t *testing.T) { return } - // needed so that modTime of `file` is different to its current value after ioutil.WriteFile - time.Sleep(1000 * time.Millisecond) + time.Sleep(200 * time.Millisecond) // Now replace file contents with crap if err := ioutil.WriteFile(file, []byte("foo"), 0644); err != nil {