diff options
author | Martin Holst Swende <martin@swende.se> | 2017-11-20 19:35:30 +0800 |
---|---|---|
committer | Martin Holst Swende <martin@swende.se> | 2017-11-20 19:35:30 +0800 |
commit | e2b3a23663393f5101a0a38086ca0911568ed427 (patch) | |
tree | 37fb8d9a773dc21941df1966481383ae896bf33e /accounts | |
parent | 0f184d3b149807bb85f7984c46812921a4ad6165 (diff) | |
download | go-tangerine-e2b3a23663393f5101a0a38086ca0911568ed427.tar go-tangerine-e2b3a23663393f5101a0a38086ca0911568ed427.tar.gz go-tangerine-e2b3a23663393f5101a0a38086ca0911568ed427.tar.bz2 go-tangerine-e2b3a23663393f5101a0a38086ca0911568ed427.tar.lz go-tangerine-e2b3a23663393f5101a0a38086ca0911568ed427.tar.xz go-tangerine-e2b3a23663393f5101a0a38086ca0911568ed427.tar.zst go-tangerine-e2b3a23663393f5101a0a38086ca0911568ed427.zip |
accounts/keystore: Ignore initial trigger of rescan-event
Diffstat (limited to 'accounts')
-rw-r--r-- | accounts/keystore/watch.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/accounts/keystore/watch.go b/accounts/keystore/watch.go index 602300b10..bbcfb9925 100644 --- a/accounts/keystore/watch.go +++ b/accounts/keystore/watch.go @@ -81,10 +81,14 @@ func (w *watcher) loop() { // When an event occurs, the reload call is delayed a bit so that // multiple events arriving quickly only cause a single reload. var ( - debounce = time.NewTimer(0) debounceDuration = 500 * time.Millisecond rescanTriggered = false + debounce = time.NewTimer(0) ) + // Ignore initial trigger + if !debounce.Stop() { + <-debounce.C + } defer debounce.Stop() for { select { |