fix nil pointer if there's no pending batches

This commit is contained in:
jonastheis
2025-05-20 15:16:57 +02:00
parent 97de988228
commit 5f29e22815

View File

@@ -327,6 +327,11 @@ func (r *Layer2Relayer) ProcessPendingBatches() {
return
}
// nothing to do if we don't have any pending batches
if len(dbBatches) == 0 {
return
}
// if backlog outgrow max size, forcesubmit enough oldest batches
backlogCount, err := r.batchOrm.GetFailedAndPendingBatchesCount(r.ctx)
if err != nil {