eth: inline the function

This commit is contained in:
Gary Rong 2023-09-26 19:33:18 +08:00
parent bcd5792ca4
commit b98b30bcb8

View file

@ -179,13 +179,8 @@ func newHandler(config *handlerConfig) (*handler, error) {
log.Info("Enabled snap sync", "head", head.Number, "hash", head.Hash())
}
}
// If the sync succeeds, mark the local node as synced and enable all features
// with state synchronization requirements.
success := func() {
h.enableSyncedFeatures()
}
// Construct the downloader (long sync)
h.downloader = downloader.New(config.Database, h.eventMux, h.chain, nil, h.removePeer, success)
h.downloader = downloader.New(config.Database, h.eventMux, h.chain, nil, h.removePeer, h.enableSyncedFeatures)
if ttd := h.chain.Config().TerminalTotalDifficulty; ttd != nil {
if h.chain.Config().TerminalTotalDifficultyPassed {
log.Info("Chain post-merge, sync via beacon client")