Chain.TD¶
| Source (upstream pre-purge) | Current | |
|---|---|---|
| File | cmd/devp2p/internal/ethtest/chain.go |
chain.go |
| Symbol | Chain.TD |
Chain.TD |
| Ref | 39638c81c~1 |
etc/v1.17.3-full-node |
Upstream zeroed out in TD nuke (39638c81c). Restored to sum block difficulties, matching core-geth and pre-nuke upstream. Required for ETH/68 status validation.
3-way merge — purge → getc ← upstream¶
pre-purgecommon
// TD calculates the total difficulty of the chain at the
// chain head.
func (c *Chain) TD() *big.Int {
↗ sum := new(big.Int)
for _, block := range c.blocks[:c.Len()] {
sum.Add(sum, block.Difficulty())
}
return sum
}