Skip to content

Commit

Permalink
fix crash due to out of bound
Browse files Browse the repository at this point in the history
  • Loading branch information
brewmaster012 committed Jan 12, 2024
1 parent fde9cab commit 5df11e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion zetaclient/zetacore_observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package zetaclient

import (
"fmt"
"math"
"strings"
"time"

Expand Down Expand Up @@ -158,7 +159,7 @@ func (co *CoreObserver) startCctxScheduler() {
co.logger.ZetaChainWatcher.Error().Err(err).Msgf("couldn't get operator balance")
} else {
diff := co.lastOperatorBalance.Sub(balance)
if diff.GT(sdkmath.NewInt(0)) {
if diff.GT(sdkmath.NewInt(0)) && diff.LT(sdkmath.NewInt(math.MaxInt64)) {
co.ts.AddFeeEntry(bn, diff.Int64())
co.lastOperatorBalance = balance
}
Expand Down

0 comments on commit 5df11e2

Please sign in to comment.