Skip to content

Commit

Permalink
cmd/clef: suppress fsnotify error if keydir not exists (ethereum#28160)
Browse files Browse the repository at this point in the history
As the keydir will be automatically created after an account is created, no error message if the watcher is failed.
  • Loading branch information
jsvisa authored and tyler-smith committed Oct 12, 2023
1 parent 77dda0a commit 98f45f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion accounts/keystore/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package keystore

import (
"os"
"time"

"github.com/ethereum/go-ethereum/log"
Expand Down Expand Up @@ -77,7 +78,9 @@ func (w *watcher) loop() {
}
defer watcher.Close()
if err := watcher.Add(w.ac.keydir); err != nil {
logger.Warn("Failed to watch keystore folder", "err", err)
if !os.IsNotExist(err) {
logger.Warn("Failed to watch keystore folder", "err", err)
}
return
}

Expand Down

0 comments on commit 98f45f9

Please sign in to comment.