Commit 48ee0777 authored by Péter Szilágyi's avatar Péter Szilágyi

eth/downloader: add a user sync notificaton

parent ec57aa64
...@@ -65,6 +65,7 @@ type Downloader struct { ...@@ -65,6 +65,7 @@ type Downloader struct {
// Status // Status
synchronising int32 synchronising int32
notified int32
// Channels // Channels
newPeerCh chan *peer newPeerCh chan *peer
...@@ -128,6 +129,10 @@ func (d *Downloader) Synchronise(id string, hash common.Hash) error { ...@@ -128,6 +129,10 @@ func (d *Downloader) Synchronise(id string, hash common.Hash) error {
} }
defer atomic.StoreInt32(&d.synchronising, 0) 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 // Create cancel channel for aborting mid-flight
d.cancelLock.Lock() d.cancelLock.Lock()
d.cancelCh = make(chan struct{}) d.cancelCh = make(chan struct{})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment