forked from cerc-io/plugeth
cmd/geth: parse uint64 value with ParseUint instead of Atoi (#25545)
Parse uint64 value with ParseUint instead of Atoi
This commit is contained in:
parent
656dc8cc00
commit
9762ddf8b0
@ -384,12 +384,12 @@ func parseDumpConfig(ctx *cli.Context, stack *node.Node) (*state.DumpConfig, eth
|
|||||||
return nil, nil, common.Hash{}, fmt.Errorf("block %x not found", hash)
|
return nil, nil, common.Hash{}, fmt.Errorf("block %x not found", hash)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
number, err := strconv.Atoi(arg)
|
number, err := strconv.ParseUint(arg, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, common.Hash{}, err
|
return nil, nil, common.Hash{}, err
|
||||||
}
|
}
|
||||||
if hash := rawdb.ReadCanonicalHash(db, uint64(number)); hash != (common.Hash{}) {
|
if hash := rawdb.ReadCanonicalHash(db, number); hash != (common.Hash{}) {
|
||||||
header = rawdb.ReadHeader(db, hash, uint64(number))
|
header = rawdb.ReadHeader(db, hash, number)
|
||||||
} else {
|
} else {
|
||||||
return nil, nil, common.Hash{}, fmt.Errorf("header for block %d not found", number)
|
return nil, nil, common.Hash{}, fmt.Errorf("header for block %d not found", number)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user