Skip to content

Commit

Permalink
tweak empty block logic
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlyguo committed Apr 3, 2024
1 parent deefa7e commit 46857f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ func (w *worker) newWorkLoop(recommit time.Duration) {
case head := <-w.chainHeadCh:
clearPending(head.Block.NumberU64())
timestamp = time.Now().Unix()
commit(false, commitInterruptNewHead)
commit(true, commitInterruptNewHead)

case <-timer.C:
// If mining is running resubmit a new work cycle periodically to pull in
Expand All @@ -480,7 +480,7 @@ func (w *worker) newWorkLoop(recommit time.Duration) {
timer.Reset(recommit)
continue
}
commit(false, commitInterruptResubmit)
commit(true, commitInterruptResubmit)
}

case interval := <-w.resubmitIntervalCh:
Expand Down Expand Up @@ -1467,9 +1467,9 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
}

// do not produce empty blocks
if w.current.tcount == 0 {
return
}
// if w.current.tcount == 0 {
// return
// }

w.commit(uncles, w.fullTaskHook, true, tstart)
}
Expand Down
6 changes: 3 additions & 3 deletions params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (

const (
VersionMajor = 5 // Major version component of the current release
VersionMinor = 1 // Minor version component of the current release
VersionPatch = 31 // Patch version component of the current release
VersionMeta = "4844-v0" // Version metadata to append to the version string
VersionMinor = 2 // Minor version component of the current release
VersionPatch = 1 // Patch version component of the current release
VersionMeta = "4844-v1" // Version metadata to append to the version string
)

// Version holds the textual version string.
Expand Down

0 comments on commit 46857f0

Please sign in to comment.