From 77a2d0f97f142261a351f0cdcc1d001d0cead4cf Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Fri, 16 Oct 2020 15:22:23 -0400 Subject: Clean up use of pending/latest meta block numbers --- eth/filters/api.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'eth/filters/api.go') diff --git a/eth/filters/api.go b/eth/filters/api.go index 71e6454..9ee96af 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -330,6 +330,8 @@ 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 + // LatestBlockNumber is left in place here to be handled + // correctly within NewRangeFilter begin := rpc.LatestBlockNumber.Int64() if crit.FromBlock != nil { begin = crit.FromBlock.Int64() @@ -385,6 +387,9 @@ func (api *PublicFilterAPI) GetFilterLogs(ctx context.Context, id rpc.ID) ([]*ty filter = NewBlockFilter(api.backend, *f.crit.BlockHash, f.crit.Addresses, f.crit.Topics) } else { // Convert the RPC block numbers into internal representations + // Leave LatestBlockNumber in place here as the defaults + // Should be handled correctly as request for the last + // accepted block instead throughout all APIs. begin := rpc.LatestBlockNumber.Int64() if f.crit.FromBlock != nil { begin = f.crit.FromBlock.Int64() -- cgit v1.2.3