Skip to content

Commit 98f45f9

Browse files
jsvisatcrypt25519
authored andcommitted
cmd/clef: suppress fsnotify error if keydir not exists (ethereum#28160)
As the keydir will be automatically created after an account is created, no error message if the watcher is failed.
1 parent 77dda0a commit 98f45f9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

accounts/keystore/watch.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package keystore
2121

2222
import (
23+
"os"
2324
"time"
2425

2526
"github.com/ethereum/go-ethereum/log"
@@ -77,7 +78,9 @@ func (w *watcher) loop() {
7778
}
7879
defer watcher.Close()
7980
if err := watcher.Add(w.ac.keydir); err != nil {
80-
logger.Warn("Failed to watch keystore folder", "err", err)
81+
if !os.IsNotExist(err) {
82+
logger.Warn("Failed to watch keystore folder", "err", err)
83+
}
8184
return
8285
}
8386

0 commit comments

Comments
 (0)