mirror of https://github.com/status-im/op-geth.git
Merge pull request #15527 from holiman/bump_watch
accounts/keystore: Ignore initial trigger of rescan-event
This commit is contained in:
commit
7b95cca56c
|
@ -81,10 +81,14 @@ func (w *watcher) loop() {
|
||||||
// When an event occurs, the reload call is delayed a bit so that
|
// When an event occurs, the reload call is delayed a bit so that
|
||||||
// multiple events arriving quickly only cause a single reload.
|
// multiple events arriving quickly only cause a single reload.
|
||||||
var (
|
var (
|
||||||
debounce = time.NewTimer(0)
|
|
||||||
debounceDuration = 500 * time.Millisecond
|
debounceDuration = 500 * time.Millisecond
|
||||||
rescanTriggered = false
|
rescanTriggered = false
|
||||||
|
debounce = time.NewTimer(0)
|
||||||
)
|
)
|
||||||
|
// Ignore initial trigger
|
||||||
|
if !debounce.Stop() {
|
||||||
|
<-debounce.C
|
||||||
|
}
|
||||||
defer debounce.Stop()
|
defer debounce.Stop()
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
|
Loading…
Reference in New Issue