We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e62e3e4 commit 26fcc18Copy full SHA for 26fcc18
bridges/ethKC/bridgeExecutor.go
@@ -157,7 +157,8 @@ func (executor *bridgeExecutor) MyTurnAsLeader() bool {
157
func (executor *bridgeExecutor) GetBatchFromKC(ctx context.Context) (*bridgeCore.TransferBatch, error) {
158
batch, err := executor.kcClient.GetPendingBatch(ctx)
159
if err == nil {
160
- executor.statusHandler.SetIntMetric(bridgeCore.MetricNumBatches, safeUint64ToInt(batch.ID)-1)
+ n := max(safeUint64ToInt(batch.ID)-1, 0)
161
+ executor.statusHandler.SetIntMetric(bridgeCore.MetricNumBatches, n)
162
if len(batch.Deposits) > 0 {
163
lastDeposit := batch.Deposits[len(batch.Deposits)-1]
164
executor.statusHandler.SetIntMetric(bridgeCore.MetricCurrentDepositNonce, safeUint64ToInt(lastDeposit.Nonce))
0 commit comments