mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
eth/downloader: hold pivotLock when marking pivot committed (#35405)
commitPivotBlock updated committed without pivotLock, while other pivot transitions serialize through that lock. Take the lock around the store to keep pivot commitment consistent with pivotHeader updates.
This commit is contained in:
parent
a524f2bb17
commit
cd65ccad96
1 changed files with 2 additions and 0 deletions
|
|
@ -1109,7 +1109,9 @@ func (d *Downloader) commitPivotBlock(result *fetchResult) error {
|
|||
if err := d.blockchain.SnapSyncComplete(block.Hash(), d.snapSyncer.Version() == snap.SNAP2); err != nil {
|
||||
return err
|
||||
}
|
||||
d.pivotLock.Lock()
|
||||
d.committed.Store(true)
|
||||
d.pivotLock.Unlock()
|
||||
|
||||
// The chain has obtained a stateful head by committing the pivot block,
|
||||
// the mission of the snap sync is regarded as accomplished and the mode
|
||||
|
|
|
|||
Loading…
Reference in a new issue