Skip to content

BlockChain.SetPreserve

NEW-ETC — no upstream or core-geth original.

File blockchain_pow.go
Symbol BlockChain.SetPreserve
Ref etc/v1.17.4-full-node

NEW-ETC wiring: installs the fork-choice preserve callback. Pre-purge upstream threaded it into NewBlockChain; v1.17.4's NewBlockChain no longer takes it, so getc sets it after construction from eth/backend.go once the etherbase is available. No-op on non-PoW chains.

// SetPreserve installs the fork-choice preserve callback; no-op on non-PoW chains.
func (bc *BlockChain) SetPreserve(preserve func(header *types.Header) bool) {
    if bc.forker != nil {
        bc.forker.preserve = preserve
    }
}

← Total Difficulty (TD)