From 0636e17dbee3accf6291000f0e4f4e713a97a207 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 9 Apr 2015 16:37:04 +0200 Subject: Added default registrar --- core/chain_manager.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'core') diff --git a/core/chain_manager.go b/core/chain_manager.go index 3ab95d272..9c66a9f53 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -50,15 +50,7 @@ func CalcDifficulty(block, parent *types.Header) *big.Int { } func CalculateTD(block, parent *types.Block) *big.Int { - uncleDiff := new(big.Int) - for _, uncle := range block.Uncles() { - uncleDiff = uncleDiff.Add(uncleDiff, uncle.Difficulty) - } - - // TD(genesis_block) = 0 and TD(B) = TD(B.parent) + sum(u.difficulty for u in B.uncles) + B.difficulty - td := new(big.Int) - td = td.Add(parent.Td, uncleDiff) - td = td.Add(td, block.Header().Difficulty) + td := new(big.Int).Add(parent.Td, block.Header().Difficulty) return td } -- cgit v1.2.3