mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
accounts/keystore: Ignore initial trigger of rescan-event
This commit is contained in:
parent
0f184d3b14
commit
e2b3a23663
1 changed files with 5 additions and 1 deletions
|
|
@ -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 a new issue