Merge pull request #4474 from harmony-one/fix/consensus_catchup

fix consensus catchup issue
pull/4486/head
Casey Gardiner 1 year ago committed by GitHub
commit 99bb6326b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      node/node_syncing.go

@ -352,7 +352,7 @@ func (node *Node) NodeSyncing() {
if node.HarmonyConfig.TiKV.Role == tikv.RoleWriter { if node.HarmonyConfig.TiKV.Role == tikv.RoleWriter {
node.supportSyncing() // the writer needs to be in sync with it's other peers 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 node.supportSyncing() // for non-writer-reader mode a.k.a tikv nodes
} }
} }
@ -372,6 +372,11 @@ func (node *Node) supportSyncing() {
go node.SendNewBlockToUnsync() 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 { if !node.NodeConfig.StagedSync && node.stateSync == nil {
node.stateSync = node.createStateSync(node.Blockchain()) node.stateSync = node.createStateSync(node.Blockchain())
utils.Logger().Debug().Msg("[SYNC] initialized state sync") utils.Logger().Debug().Msg("[SYNC] initialized state sync")

Loading…
Cancel
Save