Skip to content

Commit

Permalink
Merge pull request #4474 from harmony-one/fix/consensus_catchup
Browse files Browse the repository at this point in the history
fix consensus catchup issue
  • Loading branch information
ONECasey authored Aug 4, 2023
2 parents 944b8c7 + a5634ed commit 99bb632
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion node/node_syncing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand All @@ -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")
Expand Down

0 comments on commit 99bb632

Please sign in to comment.