good morning!!!!

Skip to content
Snippets Groups Projects
Commit c4a1d4fe authored by Gary Rong's avatar Gary Rong Committed by Péter Szilágyi
Browse files

eth/filters: fix the block range assignment for log filter (#17284)

parent fb9f7261
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment