Skip to content

Commit dad8f23

Browse files
authored
eth/downloader: correct sync mode logging to show old mode (#30219)
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.
1 parent ff6e43e commit dad8f23

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

eth/downloader/beaconsync.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ func (b *beaconBackfiller) resume() {
123123
func (b *beaconBackfiller) setMode(mode SyncMode) {
124124
// Update the old sync mode and track if it was changed
125125
b.lock.Lock()
126-
updated := b.syncMode != mode
126+
oldMode := b.syncMode
127+
updated := oldMode != mode
127128
filling := b.filling
128129
b.syncMode = mode
129130
b.lock.Unlock()
@@ -133,8 +134,8 @@ func (b *beaconBackfiller) setMode(mode SyncMode) {
133134
if !updated || !filling {
134135
return
135136
}
136-
log.Error("Downloader sync mode changed mid-run", "old", mode.String(), "new", mode.String())
137-
b.suspend()
137+
log.Error("Downloader sync mode changed mid-run", "old", oldMode.String(), "new", mode.String())
138+
b.suspend()
138139
b.resume()
139140
}
140141

0 commit comments

Comments
 (0)