diff options
-rw-r--r-- | core/chain_manager.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go index e97ed307c..9f62d3b47 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -49,6 +49,10 @@ func CalcDifficulty(block, parent *types.Header) *big.Int { } func CalculateTD(block, parent *types.Block) *big.Int { + if parent == nil { + return block.Difficulty() + } + td := new(big.Int).Add(parent.Td, block.Header().Difficulty) return td |