Skip to content

Commit c0c0d4d

Browse files
Potential fix for code scanning alert no. 29: Incorrect conversion between integer types
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 6a9f2de commit c0c0d4d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmd/monitorv2/renderer/tview_renderer.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2692,11 +2692,12 @@ func (t *TviewRenderer) searchBlockByNumber(blockNum uint64) {
26922692
defer cancel()
26932693

26942694
// Convert to big.Int for the indexer call
2695+
var constrainedBlockNum uint64 = blockNum
26952696
if blockNum > math.MaxInt64 {
26962697
log.Error().Uint64("block_num", blockNum).Msg("Block number exceeds int64 range, using MaxInt64")
2697-
blockNum = math.MaxInt64
2698+
constrainedBlockNum = math.MaxInt64
26982699
}
2699-
blockNumber := big.NewInt(int64(blockNum))
2700+
blockNumber := big.NewInt(int64(constrainedBlockNum))
27002701

27012702
block, err := t.indexer.GetBlock(ctx, blockNumber)
27022703
if err != nil {

0 commit comments

Comments
 (0)