|
|
|
@ -352,7 +352,7 @@ func (node *Node) NodeSyncing() { |
|
|
|
|
if node.HarmonyConfig.TiKV.Role == tikv.RoleWriter { |
|
|
|
|
node.supportSyncing() // the writer needs to be in sync with it's other peers
|
|
|
|
|
} |
|
|
|
|
} else if !node.HarmonyConfig.General.IsOffline && node.HarmonyConfig.DNSSync.Client { |
|
|
|
|
} else if !node.HarmonyConfig.General.IsOffline && (node.HarmonyConfig.DNSSync.Client || node.HarmonyConfig.Sync.Downloader) { |
|
|
|
|
node.supportSyncing() // for non-writer-reader mode a.k.a tikv nodes
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -372,6 +372,11 @@ func (node *Node) supportSyncing() { |
|
|
|
|
go node.SendNewBlockToUnsync() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// if stream sync client is running, don't create other sync client instances
|
|
|
|
|
if node.HarmonyConfig.Sync.Downloader { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if !node.NodeConfig.StagedSync && node.stateSync == nil { |
|
|
|
|
node.stateSync = node.createStateSync(node.Blockchain()) |
|
|
|
|
utils.Logger().Debug().Msg("[SYNC] initialized state sync") |
|
|
|
|