-// CalcNextBits calculate the bits for next block
-func (node *BlockNode) CalcNextBits() uint64 {
- if node.Height%consensus.BlocksPerRetarget != 0 || node.Height == 0 {
- return node.Bits
- }
-
- compareNode := node.Parent
- for compareNode.Height%consensus.BlocksPerRetarget != 0 {
- compareNode = compareNode.Parent
- }
- return difficulty.CalcNextRequiredDifficulty(node.BlockHeader(), compareNode.BlockHeader())
-}
-
-// CalcNextSeed calculate the seed for next block
-func (node *BlockNode) CalcNextSeed() *bc.Hash {
- if node.Height == 0 {
- return consensus.InitialSeed
- }
- if node.Height%consensus.SeedPerRetarget == 0 {
- return &node.Hash
- }
- return node.Seed
-}
-