mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
eth/beacon: correct sync mode logging to show old mode
This commit is contained in:
parent
ac0f220040
commit
cfefe2c1a4
1 changed files with 4 additions and 3 deletions
|
|
@ -123,7 +123,8 @@ func (b *beaconBackfiller) resume() {
|
||||||
func (b *beaconBackfiller) setMode(mode SyncMode) {
|
func (b *beaconBackfiller) setMode(mode SyncMode) {
|
||||||
// Update the old sync mode and track if it was changed
|
// Update the old sync mode and track if it was changed
|
||||||
b.lock.Lock()
|
b.lock.Lock()
|
||||||
updated := b.syncMode != mode
|
oldMode := b.syncMode
|
||||||
|
updated := oldMode != mode
|
||||||
filling := b.filling
|
filling := b.filling
|
||||||
b.syncMode = mode
|
b.syncMode = mode
|
||||||
b.lock.Unlock()
|
b.lock.Unlock()
|
||||||
|
|
@ -133,7 +134,7 @@ func (b *beaconBackfiller) setMode(mode SyncMode) {
|
||||||
if !updated || !filling {
|
if !updated || !filling {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Error("Downloader sync mode changed mid-run", "old", mode.String(), "new", mode.String())
|
log.Error("Downloader sync mode changed mid-run", "old", oldMode.String(), "new", mode.String())
|
||||||
b.suspend()
|
b.suspend()
|
||||||
b.resume()
|
b.resume()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue