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
gzliudan committed Jan 16, 2025
1 parent 84d21a3 commit 2970f1a
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/XinFinOrg/XDPoSChain/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 2970f1a

Please sign in to comment.