Skip to content

Commit

Permalink
netsync: always call resetHeaderState on Syncmanager.New()
Browse files Browse the repository at this point in the history
Since we're purely headers-first during ibd, we need to call
resetHeaderState regardless of whether or not we have more checkpmore
checkpoints.
  • Loading branch information
kcalvinalvin committed Jan 8, 2025
1 parent f1bdaa5 commit cd40440
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions netsync/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2305,12 +2305,10 @@ func New(config *Config) (*SyncManager, error) {
if !config.DisableCheckpoints {
// Initialize the next checkpoint based on the current height.
sm.nextCheckpoint = sm.findNextHeaderCheckpoint(best.Height)
if sm.nextCheckpoint != nil {
sm.resetHeaderState(&best.Hash, best.Height)
}
} else {
log.Info("Checkpoints are disabled")
}
sm.resetHeaderState(&best.Hash, best.Height)

// If we're at assume utreexo mode, build headers first.
if sm.chain.IsUtreexoViewActive() && sm.chain.IsAssumeUtreexo() {
Expand Down

0 comments on commit cd40440

Please sign in to comment.