initialize consensus viewID with viewID information stored in block header instead of using block height

pull/1737/head
chao 5 years ago
parent 9ef6c8a135
commit 86bed02100
  1. 7
      cmd/harmony/main.go

@ -387,11 +387,10 @@ func setupConsensusAndNode(nodeConfig *nodeconfig.ConfigType) *node.Node {
} }
// Set the consensus ID to be the current block number // Set the consensus ID to be the current block number
height := currentNode.Blockchain().CurrentBlock().NumberU64() viewID := currentNode.Blockchain().CurrentBlock().Header().ViewID().Uint64()
currentConsensus.SetViewID(viewID)
currentConsensus.SetViewID(height)
utils.Logger().Info(). utils.Logger().Info().
Uint64("height", height). Uint64("viewID", viewID).
Msg("Init Blockchain") Msg("Init Blockchain")
// Assign closure functions to the consensus object // Assign closure functions to the consensus object

Loading…
Cancel
Save