diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-10-21 18:25:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-21 18:25:38 +0800 |
commit | 437c1e40b297efe6216e1d13840cee79f2dd643c (patch) | |
tree | b34fd78bcf46e5545643d0622a71a061149a5df3 | |
parent | 28cc3cc96069d7911b0bd8e9f68835cc52b52140 (diff) | |
parent | 53db80da89ac736614cfcfc10ea40ac5f91b2646 (diff) | |
download | dexon-437c1e40b297efe6216e1d13840cee79f2dd643c.tar dexon-437c1e40b297efe6216e1d13840cee79f2dd643c.tar.gz dexon-437c1e40b297efe6216e1d13840cee79f2dd643c.tar.bz2 dexon-437c1e40b297efe6216e1d13840cee79f2dd643c.tar.lz dexon-437c1e40b297efe6216e1d13840cee79f2dd643c.tar.xz dexon-437c1e40b297efe6216e1d13840cee79f2dd643c.tar.zst dexon-437c1e40b297efe6216e1d13840cee79f2dd643c.zip |
Merge pull request #3185 from karalabe/fix-log-race
eth/downloader: fix a data race in a log output
-rw-r--r-- | eth/downloader/downloader.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index e9dd05248..987be2b7a 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -948,11 +948,12 @@ func (d *Downloader) fetchNodeData() error { } d.syncStatsLock.Lock() d.syncStatsStateDone += uint64(delivered) + syncStatsStateDone := d.syncStatsStateDone // Thread safe copy for the log below d.syncStatsLock.Unlock() // Log a message to the user and return if delivered > 0 { - glog.V(logger.Info).Infof("imported %3d state entries in %9v: processed %d, pending at least %d", delivered, common.PrettyDuration(time.Since(start)), d.syncStatsStateDone, pending) + glog.V(logger.Info).Infof("imported %3d state entries in %9v: processed %d, pending at least %d", delivered, common.PrettyDuration(time.Since(start)), syncStatsStateDone, pending) } }) } |