- c.consensusNodeMap = consensusNodeMap
- c.effectiveStartHeight = bestBlockHeight / roundVoteBlockNums * roundVoteBlockNums
- return nil
-}
-
-func getLastBlockTimeInTimeRange(startTimestamp, endTimestamp, order uint64) uint64 {
- // One round of product block time for all consensus nodes
- roundBlockTime := uint64(BlockNumEachNode * numOfConsensusNode * BlockTimeInterval)
- // The start time of the last round of product block
- lastRoundStartTime := startTimestamp + (endTimestamp-startTimestamp)/roundBlockTime*roundBlockTime
- // The time of product block of the consensus in last round
- return lastRoundStartTime + order*(BlockNumEachNode*BlockTimeInterval)
-}
+ for _, bh := range detachBlockHeaders {
+ blockHash := bh.Hash()
+ block, err := c.store.GetBlock(&blockHash)
+ if err != nil {
+ return err
+ }