mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
Simplify CalculateTD function
This commit is contained in:
parent
ac85fdc75e
commit
fee99b3e8d
1 changed files with 1 additions and 4 deletions
|
|
@ -52,10 +52,7 @@ 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
|
||||
return new(big.Int).Add(parent.Td, block.Difficulty())
|
||||
}
|
||||
|
||||
func CalcGasLimit(parent *types.Block) *big.Int {
|
||||
|
|
|
|||
Loading…
Reference in a new issue