Skip to content

ReadTdRLP

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

3-way merge — purge → getc ← upstream

pre-purge
// ReadTdRLP retrieves a block's total difficulty corresponding to the hash in RLP encoding.
func ReadTdRLP(db ethdb.Reader, hash common.Hash, number uint64) rlp.RawValue {
var data []byte
db.ReadAncients(func(reader ethdb.AncientReaderOp) error {
// Check if the data is in ancients
if isCanon(reader, number, hash) {
data, _ = reader.Ancient(ChainFreezerDifficultyTable, number)
return nil
}
// If not, try reading from leveldb
data, _ = db.Get(headerTDKey(number, hash))
return nil
})
return data
}
core-geth validation — **Identical** ✅ | | | |---|---| | File | [`accessors_chain.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/core/rawdb/accessors_chain.go) | | Symbol | `ReadTdRLP` | | Ref | `v1.12.20` |

← Total Difficulty (TD)