mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
cgh: use geth for maxInt
This commit is contained in:
parent
32138d70ad
commit
0634d11d86
1 changed files with 2 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common/math"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/rpc"
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
|
|
||||||
|
|
@ -118,7 +119,7 @@ func getRpcBlockNumberFromString(blockNumber string) (rpc.BlockNumber, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return rpc.BlockNumber(0), errors.New("invalid block number")
|
return rpc.BlockNumber(0), errors.New("invalid block number")
|
||||||
}
|
}
|
||||||
if blckNum > uint64(^uint32(0)) {
|
if blckNum > math.MaxInt64 {
|
||||||
return rpc.BlockNumber(0), errors.New("block number out of range")
|
return rpc.BlockNumber(0), errors.New("block number out of range")
|
||||||
}
|
}
|
||||||
return rpc.BlockNumber(blckNum), nil
|
return rpc.BlockNumber(blckNum), nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue