Simplify CalculateTD function

This commit is contained in:
Gustav Simonsson 2015-05-05 03:09:44 +02:00
parent ac85fdc75e
commit fee99b3e8d

View file

@ -52,10 +52,7 @@ func CalculateTD(block, parent *types.Block) *big.Int {
if parent == nil { if parent == nil {
return block.Difficulty() return block.Difficulty()
} }
return new(big.Int).Add(parent.Td, block.Difficulty())
td := new(big.Int).Add(parent.Td, block.Header().Difficulty)
return td
} }
func CalcGasLimit(parent *types.Block) *big.Int { func CalcGasLimit(parent *types.Block) *big.Int {