mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-16 18:00:46 +00:00
Merge pull request #441 from gzliudan/fix-issue-440
Fix panic during test (#440)
This commit is contained in:
commit
8563ee38c0
1 changed files with 3 additions and 2 deletions
|
|
@ -61,7 +61,7 @@ func (fc *fileCache) scan(keyDir string) (mapset.Set, mapset.Set, mapset.Set, er
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("scan get FileInfo", "err", err, "path", path)
|
log.Warn("scan get FileInfo", "err", err, "path", path)
|
||||||
}
|
}
|
||||||
if skipKeyFile(fiInfo) {
|
if fiInfo == nil || skipKeyFile(fiInfo) {
|
||||||
log.Trace("Ignoring file on account scan", "path", path)
|
log.Trace("Ignoring file on account scan", "path", path)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
@ -94,7 +94,8 @@ func (fc *fileCache) scan(keyDir string) (mapset.Set, mapset.Set, mapset.Set, er
|
||||||
// skipKeyFile ignores editor backups, hidden files and folders/symlinks.
|
// skipKeyFile ignores editor backups, hidden files and folders/symlinks.
|
||||||
func skipKeyFile(fi os.FileInfo) bool {
|
func skipKeyFile(fi os.FileInfo) bool {
|
||||||
// Skip editor backups and UNIX-style hidden files.
|
// Skip editor backups and UNIX-style hidden files.
|
||||||
if strings.HasSuffix(fi.Name(), "~") || strings.HasPrefix(fi.Name(), ".") {
|
name := fi.Name()
|
||||||
|
if strings.HasSuffix(name, "~") || strings.HasPrefix(name, ".") {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// Skip misc special files, directories (yes, symlinks too).
|
// Skip misc special files, directories (yes, symlinks too).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue