Skip to content

Commit 48ee077

Browse files
committed
eth/downloader: add a user sync notificaton
1 parent ec57aa6 commit 48ee077

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎eth/downloader/downloader.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ type Downloader struct {
6565

6666
// Status
6767
synchronising int32
68+
notified int32
6869

6970
// Channels
7071
newPeerCh chan *peer
@@ -128,6 +129,10 @@ func (d *Downloader) Synchronise(id string, hash common.Hash) error {
128129
}
129130
defer atomic.StoreInt32(&d.synchronising, 0)
130131

132+
// Post a user notification of the sync (only once per session)
133+
if atomic.CompareAndSwapInt32(&d.notified, 0, 1) {
134+
glog.V(logger.Info).Infoln("Block synchronisation started")
135+
}
131136
// Create cancel channel for aborting mid-flight
132137
d.cancelLock.Lock()
133138
d.cancelCh = make(chan struct{})

0 commit comments

Comments
 (0)