From 48ee0777a5acbf59aab691866eae5e9adf172f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Wed, 13 May 2015 16:03:05 +0300 Subject: [PATCH] eth/downloader: add a user sync notificaton --- eth/downloader/downloader.go | 5 +++++ 1 file changed, 5 insertions(+) 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{})