Skip to content

Commit 590af1f

Browse files
committed
Don't resolve virtual if updateVirtual
1 parent b871737 commit 590af1f

File tree

1 file changed

+9
-5
lines changed
  • app/protocol/flows/v5/blockrelay

1 file changed

+9
-5
lines changed

app/protocol/flows/v5/blockrelay/ibd.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,15 @@ func (flow *handleIBDFlow) syncMissingBlockBodies(highHash *externalapi.DomainHa
679679
progressReporter.reportProgress(len(hashesToRequest), highestProcessedDAAScore)
680680
}
681681

682-
return flow.resolveVirtual(highestProcessedDAAScore)
682+
// We need to resolve virtual only if it wasn't updated while syncing block bodies
683+
if !updateVirtual {
684+
err := flow.resolveVirtual(highestProcessedDAAScore)
685+
if err != nil {
686+
return err
687+
}
688+
}
689+
690+
return flow.OnNewBlockTemplate()
683691
}
684692

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

713721
log.Infof("Resolved virtual")
714-
err = flow.OnNewBlockTemplate()
715-
if err != nil {
716-
return err
717-
}
718722
return nil
719723
}

0 commit comments

Comments
 (0)