mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-05 19:43:47 +00:00
eth/downloader: hold pivotLock when reading pivot header in progress report (#35462)
This commit is contained in:
parent
6d201e61c6
commit
9b702a9955
1 changed files with 2 additions and 0 deletions
|
|
@ -1247,7 +1247,9 @@ func (d *Downloader) reportSnapSyncProgress(force bool) {
|
|||
latest, _, _, err := d.skeleton.Bounds()
|
||||
if err != nil {
|
||||
// We're going to cheat for non-merged networks, but that's fine
|
||||
d.pivotLock.RLock()
|
||||
latest = d.pivotHeader
|
||||
d.pivotLock.RUnlock()
|
||||
}
|
||||
if latest == nil {
|
||||
// This should really never happen, but add some defensive code for now.
|
||||
|
|
|
|||
Loading…
Reference in a new issue