Skip to content

Commit

Permalink
Don't resolve virtual if updateVirtual
Browse files Browse the repository at this point in the history
  • Loading branch information
someone235 committed Sep 8, 2022
1 parent b871737 commit 590af1f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions app/protocol/flows/v5/blockrelay/ibd.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,15 @@ func (flow *handleIBDFlow) syncMissingBlockBodies(highHash *externalapi.DomainHa
progressReporter.reportProgress(len(hashesToRequest), highestProcessedDAAScore)
}

return flow.resolveVirtual(highestProcessedDAAScore)
// We need to resolve virtual only if it wasn't updated while syncing block bodies
if !updateVirtual {
err := flow.resolveVirtual(highestProcessedDAAScore)
if err != nil {
return err
}
}

return flow.OnNewBlockTemplate()
}

func (flow *handleIBDFlow) banIfBlockIsHeaderOnly(block *externalapi.DomainBlock) error {
Expand Down Expand Up @@ -711,9 +719,5 @@ func (flow *handleIBDFlow) resolveVirtual(estimatedVirtualDAAScoreTarget uint64)
}

log.Infof("Resolved virtual")
err = flow.OnNewBlockTemplate()
if err != nil {
return err
}
return nil
}

0 comments on commit 590af1f

Please sign in to comment.