mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-08 14:04:29 +00:00
core: remove unused function writeHeader
This commit is contained in:
parent
6114a3a13b
commit
a5c48e77bd
1 changed files with 0 additions and 20 deletions
|
|
@ -2442,26 +2442,6 @@ func (bc *BlockChain) InsertHeaderChain(chain []*types.Header, checkFreq int) (i
|
||||||
return bc.hc.InsertHeaderChain(chain, whFunc, start)
|
return bc.hc.InsertHeaderChain(chain, whFunc, start)
|
||||||
}
|
}
|
||||||
|
|
||||||
// writeHeader writes a header into the local chain, given that its parent is
|
|
||||||
// already known. If the total difficulty of the newly inserted header becomes
|
|
||||||
// greater than the current known TD, the canonical chain is re-routed.
|
|
||||||
//
|
|
||||||
// Note: This method is not concurrent-safe with inserting blocks simultaneously
|
|
||||||
// into the chain, as side effects caused by reorganisations cannot be emulated
|
|
||||||
// without the real blocks. Hence, writing headers directly should only be done
|
|
||||||
// in two scenarios: pure-header mode of operation (light clients), or properly
|
|
||||||
// separated header/block phases (non-archive clients).
|
|
||||||
func (bc *BlockChain) writeHeader(header *types.Header) error {
|
|
||||||
bc.wg.Add(1)
|
|
||||||
defer bc.wg.Done()
|
|
||||||
|
|
||||||
bc.mu.Lock()
|
|
||||||
defer bc.mu.Unlock()
|
|
||||||
|
|
||||||
_, err := bc.hc.WriteHeader(header)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// CurrentHeader retrieves the current head header of the canonical chain. The
|
// CurrentHeader retrieves the current head header of the canonical chain. The
|
||||||
// header is retrieved from the HeaderChain's internal cache.
|
// header is retrieved from the HeaderChain's internal cache.
|
||||||
func (bc *BlockChain) CurrentHeader() *types.Header {
|
func (bc *BlockChain) CurrentHeader() *types.Header {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue