Skip to content

Commit

Permalink
rename force to reorging
Browse files Browse the repository at this point in the history
  • Loading branch information
omerfirmak committed Sep 9, 2024
1 parent ce944f8 commit 7dc72c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions miner/scroll_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,14 +774,14 @@ func (e retryableCommitError) Unwrap() error {

// commit runs any post-transaction state modifications, assembles the final block
// and commits new work if consensus engine is running.
func (w *worker) commit(force bool) (common.Hash, error) {
func (w *worker) commit(reorging bool) (common.Hash, error) {
sealDelay := time.Duration(0)
defer func(t0 time.Time) {
l2CommitTimer.Update(time.Since(t0) - sealDelay)
}(time.Now())

w.updateSnapshot()
if !w.isRunning() && !force {
if !w.isRunning() && !reorging {
return common.Hash{}, nil
}

Expand Down Expand Up @@ -858,7 +858,7 @@ func (w *worker) commit(force bool) (common.Hash, error) {

currentHeight := w.current.header.Number.Uint64()
maxReorgDepth := uint64(w.config.CCCMaxWorkers + 1)
if !force && currentHeight > maxReorgDepth {
if !reorging && currentHeight > maxReorgDepth {
ancestorHeight := currentHeight - maxReorgDepth
ancestorHash := w.chain.GetHeaderByNumber(ancestorHeight).Hash()
if rawdb.ReadBlockRowConsumption(w.chain.Database(), ancestorHash) == nil {
Expand Down

0 comments on commit 7dc72c8

Please sign in to comment.