Skip to content

Commit 7b95cca

Browse files
authored
Merge pull request #15527 from holiman/bump_watch
accounts/keystore: Ignore initial trigger of rescan-event
2 parents 0f184d3 + e2b3a23 commit 7b95cca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

accounts/keystore/watch.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,14 @@ func (w *watcher) loop() {
8181
// When an event occurs, the reload call is delayed a bit so that
8282
// multiple events arriving quickly only cause a single reload.
8383
var (
84-
debounce = time.NewTimer(0)
8584
debounceDuration = 500 * time.Millisecond
8685
rescanTriggered = false
86+
debounce = time.NewTimer(0)
8787
)
88+
// Ignore initial trigger
89+
if !debounce.Stop() {
90+
<-debounce.C
91+
}
8892
defer debounce.Stop()
8993
for {
9094
select {

0 commit comments

Comments
 (0)