Skip to content
This repository has been archived by the owner on Feb 18, 2025. It is now read-only.

Commit

Permalink
miner/worker: skip the uncle logic in Consortium
Browse files Browse the repository at this point in the history
In Consortium consensus engine, we don't handle uncle blocks. Furthermore, the
uncle logic in worker may block the main creating block logic. So this commit
skips the uncle logic when Consortium consensus engine is used.
  • Loading branch information
minh-bq committed Feb 22, 2024
1 parent 12a4522 commit 7b27479
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 @@ -513,6 +513,10 @@ func (w *worker) mainLoop() {
w.commitNewWork(req.interrupt, req.noempty, req.timestamp)

case ev := <-w.chainSideCh:
// Don't handle uncle logic in Consortium
if w.chainConfig.Consortium != nil {
continue
}
// Short circuit for duplicate side blocks
if _, exist := w.localUncles[ev.Block.Hash()]; exist {
continue
Expand Down

0 comments on commit 7b27479

Please sign in to comment.