Skip to content

ReadTd

Source (upstream pre-purge) Current
File core/rawdb/accessors_chain.go accessors_pow.go
Symbol ReadTd ReadTd
Ref f4d53133f~1 etc/v1.17.3-full-node

3-way merge — purge → getc ← upstream

pre-purge
// ReadTd retrieves a block's total difficulty corresponding to the hash.
func ReadTd(db ethdb.Reader, hash common.Hash, number uint64) *big.Int {
data := ReadTdRLP(db, hash, number)
if len(data) == 0 {
return nil
}
td := new(big.Int)
if err := rlp.DecodeBytes(data, td); err != nil {
log.Error("Invalid block total difficulty RLP", "hash", hash, "err", err)
return nil
}
return td
}
core-geth validation — **Identical** ✅ | | | |---|---| | File | [`accessors_chain.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/core/rawdb/accessors_chain.go) | | Symbol | `ReadTd` | | Ref | `v1.12.20` |

← Total Difficulty (TD)