Skip to content

WriteTd

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

3-way merge — purge → getc ← upstream

pre-purge
// WriteTd stores the total difficulty of a block into the database.
func WriteTd(db ethdb.KeyValueWriter, hash common.Hash, number uint64, td *big.Int) {
data, err := rlp.EncodeToBytes(td)
if err != nil {
log.Crit("Failed to RLP encode block total difficulty", "err", err)
}
if err := db.Put(headerTDKey(number, hash), data); err != nil {
log.Crit("Failed to store block total difficulty", "err", err)
}
}
core-geth validation — **Identical** ✅ | | | |---|---| | File | [`accessors_chain.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/core/rawdb/accessors_chain.go) | | Symbol | `WriteTd` | | Ref | `v1.12.20` |

← Total Difficulty (TD)