mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
eth/filters: fix the block range assignment for log filter (#17284)
This commit is contained in:
parent
43f038dbac
commit
65b48159d1
1 changed files with 4 additions and 10 deletions
|
|
@ -338,18 +338,12 @@ 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)
|
||||
} else {
|
||||
begin := rpc.LatestBlockNumber.Int64()
|
||||
if crit.FromBlock != nil {
|
||||
begin = crit.FromBlock.Int64()
|
||||
}
|
||||
if crit.ToBlock == nil {
|
||||
end = int64(rpc.LatestBlockNumber)
|
||||
} else {
|
||||
end := rpc.LatestBlockNumber.Int64()
|
||||
if crit.ToBlock != nil {
|
||||
end = crit.ToBlock.Int64()
|
||||
}
|
||||
// Construct the range filter
|
||||
|
|
|
|||
Loading…
Reference in a new issue