Skip to content

Commit

Permalink
miner/worker: skip resubmit logic in Consortium
Browse files Browse the repository at this point in the history
Currently, after 3 seconds, worker tries to create another block, optimistically
thinks that it can get more transactions and earns more fee as a result.
However, this causes overhead to the main block creating flow, so skip this
logic in Consortium.
  • Loading branch information
minh-bq committed Feb 22, 2024
1 parent 7b27479 commit 321774c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ func (w *worker) newWorkLoop(recommit time.Duration) {
commit(false, commitInterruptNewHead)

case <-timer.C:
if w.chainConfig.Consortium != nil {
continue
}

// If mining is running resubmit a new work cycle periodically to pull in
// higher priced transactions. Disable this overhead for pending blocks.
if w.isRunning() && (w.chainConfig.Clique == nil || w.chainConfig.Clique.Period > 0) {
Expand Down

0 comments on commit 321774c

Please sign in to comment.