mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
mobile, ethclient, core/types: enable filtering on pending/latest logs
avoid converting big.Int to int64() (to avoid loss of information), instead convert const values to big.Int
This commit is contained in:
parent
47ff71bb9b
commit
d1f71696d1
1 changed files with 3 additions and 4 deletions
|
|
@ -257,12 +257,11 @@ func toBlockNumArg(number *big.Int) string {
|
||||||
if number == nil {
|
if number == nil {
|
||||||
return "latest"
|
return "latest"
|
||||||
}
|
}
|
||||||
switch number.Int64() {
|
if number.Cmp(big.NewInt(rpc.PendingBlockNumber.Int64())) == 0 {
|
||||||
case rpc.PendingBlockNumber.Int64():
|
|
||||||
return "pending"
|
return "pending"
|
||||||
case rpc.LatestBlockNumber.Int64():
|
} else if number.Cmp(big.NewInt(rpc.LatestBlockNumber.Int64())) == 0 {
|
||||||
return "latest"
|
return "latest"
|
||||||
case rpc.EarliestBlockNumber.Int64():
|
} else if number.Cmp(big.NewInt(rpc.EarliestBlockNumber.Int64())) == 0 {
|
||||||
return "earliest"
|
return "earliest"
|
||||||
}
|
}
|
||||||
return hexutil.EncodeBig(number)
|
return hexutil.EncodeBig(number)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue