BlockChain.WriteTd¶
| Source (upstream pre-purge) | Current | |
|---|---|---|
| File | core/blockchain.go |
blockchain_pow.go |
| Symbol | BlockChain.writeBlockWithoutState (lines 1323-1323) |
BlockChain.WriteTd |
| Ref | f4d53133f~1 |
etc/v1.17.3-full-node |
Extracted from inline rawdb.WriteTd calls in writeBlockWithoutState and others
Diff — vs pre-nuke original (reimplemented)¶
--- a/core/blockchain.go
+++ b/core/blockchain_pow.go
@@ -1 +1,5 @@
- rawdb.WriteTd(batch, block.Hash(), block.NumberU64(), td)
+// WriteTd writes the total difficulty of a block to the database.
+// This is used by ETC/PoW networks during chain insertion.
+func (bc *BlockChain) WriteTd(hash common.Hash, number uint64, td *big.Int) {
+ rawdb.WriteTd(bc.db, hash, number, td)
+}