aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eth/filters/api.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/eth/filters/api.go b/eth/filters/api.go
index 6fea14fee..5ed80a887 100644
--- a/eth/filters/api.go
+++ b/eth/filters/api.go
@@ -330,15 +330,13 @@ func (api *PublicFilterAPI) GetLogs(ctx context.Context, crit FilterCriteria) ([
filter = NewBlockFilter(api.backend, *crit.BlockHash, crit.Addresses, crit.Topics)
} else {
// Convert the RPC block numbers into internal representations
- var (
- begin int64
- end int64
- )
- if crit.FromBlock == nil {
- begin = int64(rpc.LatestBlockNumber)
+ begin := rpc.LatestBlockNumber.Int64()
+ if crit.FromBlock != nil {
+ begin = crit.FromBlock.Int64()
}
- if crit.ToBlock == nil {
- end = int64(rpc.LatestBlockNumber)
+ end := rpc.LatestBlockNumber.Int64()
+ if crit.ToBlock != nil {
+ end = crit.ToBlock.Int64()
}
// Construct the range filter
filter = NewRangeFilter(api.backend, begin, end, crit.Addresses, crit.Topics)