fix beacon-ness in legacy sync (#4428)

* fix beacon-ness

* use enum to identify beacon shard
pull/4411/merge
Gheis Mohammadi 2 years ago committed by GitHub
parent f317e536c0
commit dae82158a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      api/service/legacysync/epoch_syncing.go
  2. 3
      node/node_syncing.go

@ -92,7 +92,7 @@ func (ss *EpochSync) SyncLoop(bc core.BlockChain, consensus *consensus.Consensus
}
func syncLoop(bc core.BlockChain, syncConfig *SyncConfig) (timeout int) {
isBeacon := bc.ShardID() == 0
isBeacon := bc.ShardID() == shard.BeaconChainShardID
maxHeight, errMaxHeight := getMaxPeerHeight(syncConfig)
if errMaxHeight != nil {
utils.Logger().Info().

@ -314,7 +314,8 @@ func (node *Node) doSync(bc core.BlockChain, worker *worker.Worker, willJoinCons
if willJoinConsensus {
node.Consensus.BlocksNotSynchronized()
}
syncInstance.SyncLoop(bc, worker, false, node.Consensus, legacysync.LoopMinTime)
isBeacon := bc.ShardID() == shard.BeaconChainShardID
syncInstance.SyncLoop(bc, worker, isBeacon, node.Consensus, legacysync.LoopMinTime)
if willJoinConsensus {
node.IsSynchronized.Set()
node.Consensus.BlocksSynchronized()

Loading…
Cancel
Save