mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
triedb/pathdb: ignore pruning signal during index initialization
This commit is contained in:
parent
298e2819da
commit
0fd7a61f7f
1 changed files with 8 additions and 1 deletions
|
|
@ -831,7 +831,14 @@ func (i *historyIndexer) shorten(historyID uint64) error {
|
|||
// prune signals the pruner that the history tail has advanced to the given ID,
|
||||
// so that stale index blocks referencing pruned histories can be removed.
|
||||
func (i *historyIndexer) prune(newTail uint64) {
|
||||
i.pruner.prune(newTail)
|
||||
select {
|
||||
case <-i.initer.closed:
|
||||
log.Debug("Ignored the pruning signal", "reason", "closed")
|
||||
case <-i.initer.done:
|
||||
i.pruner.prune(newTail)
|
||||
default:
|
||||
log.Debug("Ignored the pruning signal", "reason", "busy")
|
||||
}
|
||||
}
|
||||
|
||||
// progress returns the indexing progress made so far. It provides the number
|
||||
|
|
|
|||
Loading…
Reference in a new issue