fix log range limit

pull/4189/head v4.3.10
lutty 3 years ago committed by Leo Chen
parent 021c4db669
commit 8e93ea6389
  1. 6
      rpc/filters/filter.go

@ -19,6 +19,7 @@ package filters
import (
"context"
"errors"
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/common"
@ -146,6 +147,11 @@ func (f *Filter) Logs(ctx context.Context) ([]*types.Log, error) {
if f.end == -1 {
end = head
}
if int64(end) >= f.begin && int64(end)-f.begin > rpcGetLogsLimit {
return nil, fmt.Errorf("GetLogs query must be smaller than size %v", rpcGetLogsLimit)
}
// Gather all indexed logs, and finish with non indexed ones
var (
logs []*types.Log

Loading…
Cancel
Save