Skip to content

Commit 1f12502

Browse files
jtragliaHanWang233
authored andcommitted
cmd/geth: parse uint64 value with ParseUint instead of Atoi (ethereum#25545)
Parse uint64 value with ParseUint instead of Atoi
1 parent cf69fa2 commit 1f12502

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/geth/chaincmd.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,12 @@ func parseDumpConfig(ctx *cli.Context, stack *node.Node) (*state.DumpConfig, eth
384384
return nil, nil, common.Hash{}, fmt.Errorf("block %x not found", hash)
385385
}
386386
} else {
387-
number, err := strconv.Atoi(arg)
387+
number, err := strconv.ParseUint(arg, 10, 64)
388388
if err != nil {
389389
return nil, nil, common.Hash{}, err
390390
}
391-
if hash := rawdb.ReadCanonicalHash(db, uint64(number)); hash != (common.Hash{}) {
392-
header = rawdb.ReadHeader(db, hash, uint64(number))
391+
if hash := rawdb.ReadCanonicalHash(db, number); hash != (common.Hash{}) {
392+
header = rawdb.ReadHeader(db, hash, number)
393393
} else {
394394
return nil, nil, common.Hash{}, fmt.Errorf("header for block %d not found", number)
395395
}

0 commit comments

Comments
 (0)