Skip to content

Commit

Permalink
Fix boot condition for GER signal being sent (#1837)
Browse files Browse the repository at this point in the history
* Fix boot condition for GER signal being sent

* Fix boot condition for GER signal being sent

* Fix boot condition for GER signal being sent
  • Loading branch information
arnaubennassar authored Mar 16, 2023
1 parent 78ec9d0 commit 61f4a23
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sequencer/closingsignalsmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"time"

"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/ethereum/go-ethereum/common"
)

type closingSignalsManager struct {
Expand Down Expand Up @@ -46,8 +45,13 @@ func (c *closingSignalsManager) checkSendToL1Timeout() {
}

func (c *closingSignalsManager) checkGERUpdate() {
var lastGERSent common.Hash

lastBatch, err := c.dbManager.GetLastBatch(c.ctx)
for err != nil {
log.Errorf("error getting last batch: %v", err)
time.Sleep(time.Second)
lastBatch, err = c.dbManager.GetLastBatch(c.ctx)
}
lastGERSent := lastBatch.GlobalExitRoot
for {
time.Sleep(c.cfg.ClosingSignalsManagerWaitForCheckingGER.Duration)

Expand Down

0 comments on commit 61f4a23

Please sign in to comment.