eth/downloader: hold pivotLock when reading pivot header in progress report (#35462)

This commit is contained in:
0xSHKWON 2026-08-05 15:02:01 +09:00 committed by GitHub
parent 6d201e61c6
commit 9b702a9955
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.