Skip to content

Commit

Permalink
fix slice position
Browse files Browse the repository at this point in the history
  • Loading branch information
ARR552 committed May 2, 2024
1 parent 825772a commit 9463384
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion claimtxman/claimtxman.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func (tm *ClaimTxManager) Start() {
ticker := time.NewTicker(tm.cfg.FrequencyToMonitorTxs.Duration)
compressorTicker := time.NewTicker(tm.cfg.GroupingClaims.FrequencyToProcessCompressedClaims.Duration)
var ger = &etherman.GlobalExitRoot{}
var latestProcessedGer common.Hash
for {
select {
case <-tm.ctx.Done():
Expand All @@ -121,14 +122,15 @@ func (tm *ClaimTxManager) Start() {
log.Infof("Waiting for networkID %d to be synced before processing deposits", tm.l2NetworkID)
}
case <-compressorTicker.C:
if tm.synced && tm.cfg.GroupingClaims.Enabled {
if tm.synced && tm.cfg.GroupingClaims.Enabled && ger.GlobalExitRoot != latestProcessedGer {
log.Info("Processing deposits for ger: ", ger.GlobalExitRoot)
go func() {
err := tm.updateDepositsStatus(ger)
if err != nil {
log.Errorf("failed to update deposits status: %v", err)
}
}()
latestProcessedGer = ger.GlobalExitRoot
}
case <-ticker.C:
err := tm.monitorTxs.MonitorTxs(tm.ctx)
Expand Down

0 comments on commit 9463384

Please sign in to comment.