Skip to content

Commit

Permalink
eth/downloader: correct sync mode logging to show old mode (#30219)
Browse files Browse the repository at this point in the history
This PR fixes an issue in the setMode method of beaconBackfiller where the
log message was not displaying the previous mode correctly. The log message
now shows both the old and new sync modes.
  • Loading branch information
smin-k authored Aug 1, 2024
1 parent ff6e43e commit dad8f23
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions eth/downloader/beaconsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ func (b *beaconBackfiller) resume() {
func (b *beaconBackfiller) setMode(mode SyncMode) {
// Update the old sync mode and track if it was changed
b.lock.Lock()
updated := b.syncMode != mode
oldMode := b.syncMode
updated := oldMode != mode
filling := b.filling
b.syncMode = mode
b.lock.Unlock()
Expand All @@ -133,8 +134,8 @@ func (b *beaconBackfiller) setMode(mode SyncMode) {
if !updated || !filling {
return
}
log.Error("Downloader sync mode changed mid-run", "old", mode.String(), "new", mode.String())
b.suspend()
log.Error("Downloader sync mode changed mid-run", "old", oldMode.String(), "new", mode.String())
b.suspend()
b.resume()
}

Expand Down

0 comments on commit dad8f23

Please sign in to comment.