mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
core: move pruning init a bit earlier
This commit is contained in:
parent
75fc954d96
commit
9aa4df467c
1 changed files with 6 additions and 5 deletions
|
|
@ -534,6 +534,12 @@ func (bc *BlockChain) loadLastState() error {
|
||||||
}
|
}
|
||||||
bc.hc.SetCurrentHeader(headHeader)
|
bc.hc.SetCurrentHeader(headHeader)
|
||||||
|
|
||||||
|
// Initialize history pruning.
|
||||||
|
latest := max(headBlock.NumberU64(), headHeader.Number.Uint64())
|
||||||
|
if err := bc.initializeHistoryPruning(latest); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// Restore the last known head snap block
|
// Restore the last known head snap block
|
||||||
bc.currentSnapBlock.Store(headBlock.Header())
|
bc.currentSnapBlock.Store(headBlock.Header())
|
||||||
headFastBlockGauge.Update(int64(headBlock.NumberU64()))
|
headFastBlockGauge.Update(int64(headBlock.NumberU64()))
|
||||||
|
|
@ -557,11 +563,6 @@ func (bc *BlockChain) loadLastState() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize history pruning.
|
|
||||||
if err := bc.initializeHistoryPruning(headBlock.NumberU64()); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Issue a status log for the user
|
// Issue a status log for the user
|
||||||
var (
|
var (
|
||||||
currentSnapBlock = bc.CurrentSnapBlock()
|
currentSnapBlock = bc.CurrentSnapBlock()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue