aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-05-13 21:03:05 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-05-13 21:03:05 +0800
commit48ee0777a5acbf59aab691866eae5e9adf172f95 (patch)
tree756d1c426286424b5be861375d87c2075f58eba2 /eth
parentec57aa64cda2e525687641971a54df15a04362d6 (diff)
downloaddexon-48ee0777a5acbf59aab691866eae5e9adf172f95.tar
dexon-48ee0777a5acbf59aab691866eae5e9adf172f95.tar.gz
dexon-48ee0777a5acbf59aab691866eae5e9adf172f95.tar.bz2
dexon-48ee0777a5acbf59aab691866eae5e9adf172f95.tar.lz
dexon-48ee0777a5acbf59aab691866eae5e9adf172f95.tar.xz
dexon-48ee0777a5acbf59aab691866eae5e9adf172f95.tar.zst
dexon-48ee0777a5acbf59aab691866eae5e9adf172f95.zip
eth/downloader: add a user sync notificaton
Diffstat (limited to 'eth')
-rw-r--r--eth/downloader/downloader.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go
index 0cbf42d30..ba380eca3 100644
--- a/eth/downloader/downloader.go
+++ b/eth/downloader/downloader.go
@@ -65,6 +65,7 @@ type Downloader struct {
// Status
synchronising int32
+ notified int32
// Channels
newPeerCh chan *peer
@@ -128,6 +129,10 @@ func (d *Downloader) Synchronise(id string, hash common.Hash) error {
}
defer atomic.StoreInt32(&d.synchronising, 0)
+ // Post a user notification of the sync (only once per session)
+ if atomic.CompareAndSwapInt32(&d.notified, 0, 1) {
+ glog.V(logger.Info).Infoln("Block synchronisation started")
+ }
// Create cancel channel for aborting mid-flight
d.cancelLock.Lock()
d.cancelCh = make(chan struct{})