fix: avoid committing empty blocks after the deadline (#1051)

This commit is contained in:
Ömer Faruk Irmak 2024-09-20 14:59:23 +03:00 committed by GitHub
parent d599666894
commit c0094ee0b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -396,7 +396,7 @@ func (w *worker) mainLoop() {
// be automatically eliminated. // be automatically eliminated.
if w.current != nil { if w.current != nil {
shouldCommit, _ := w.processTxnSlice(ev.Txs) shouldCommit, _ := w.processTxnSlice(ev.Txs)
if shouldCommit || w.current.deadlineReached { if shouldCommit || (w.current.deadlineReached && len(w.current.txs) > 0) {
_, err = w.commit() _, err = w.commit()
} }
} }

View file

@ -24,7 +24,7 @@ import (
const ( const (
VersionMajor = 5 // Major version component of the current release VersionMajor = 5 // Major version component of the current release
VersionMinor = 7 // Minor version component of the current release VersionMinor = 7 // Minor version component of the current release
VersionPatch = 19 // Patch version component of the current release VersionPatch = 20 // Patch version component of the current release
VersionMeta = "mainnet" // Version metadata to append to the version string VersionMeta = "mainnet" // Version metadata to append to the version string
) )