Fix getting epoch number. (#4279)

pull/4334/head
Konstantin 2 years ago committed by GitHub
parent 128db236d8
commit 4c0a28d737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      node/node.go

@ -1203,9 +1203,10 @@ func (node *Node) InitConsensusWithValidators() (err error) {
)
}
shardID := node.Consensus.ShardID
blockNum := node.Blockchain().CurrentBlock().NumberU64()
currentBlock := node.Blockchain().CurrentBlock()
blockNum := currentBlock.NumberU64()
node.Consensus.SetMode(consensus.Listening)
epoch := shard.Schedule.CalcEpochNumber(blockNum)
epoch := currentBlock.Epoch()
utils.Logger().Info().
Uint64("blockNum", blockNum).
Uint32("shardID", shardID).

Loading…
Cancel
Save