Skip to content

Commit

Permalink
consensus/parlia: limit blocks produced by backups
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBSC committed Aug 30, 2024
1 parent 1662687 commit 64b9a4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ func (p *Parlia) Seal(chain consensus.ChainHeaderReader, block *types.Block, res
case <-stop:
log.Info("Received block process finished, abort block seal")
return
case <-time.After(time.Duration(processBackOffTime) * time.Second):
case <-time.After(time.Duration(3) * time.Second):
if chain.CurrentHeader().Number.Uint64() >= header.Number.Uint64() {
log.Info("Process backoff time exhausted, and current header has updated to abort this seal")
return
Expand Down
3 changes: 3 additions & 0 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,9 @@ func (w *worker) prepareWork(genParams *generateParams) (*environment, error) {
// into the given sealing block. The transaction selection and ordering strategy can
// be customized with the plugin in the future.
func (w *worker) fillTransactions(interruptCh chan int32, env *environment, stopTimer *time.Timer, bidTxs mapset.Set[common.Hash]) (err error) {
if env.header.Difficulty.Cmp(diffInTurn) != 0 {
return nil
}
w.mu.RLock()
tip := w.tip
w.mu.RUnlock()
Expand Down

0 comments on commit 64b9a4c

Please sign in to comment.