mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
eth/filters: change limit to 1K
This commit is contained in:
parent
13f209ff47
commit
5a91d23df7
1 changed files with 4 additions and 1 deletions
|
|
@ -43,6 +43,9 @@ var (
|
||||||
// The maximum number of topic criteria allowed, vm.LOG4 - vm.LOG0
|
// The maximum number of topic criteria allowed, vm.LOG4 - vm.LOG0
|
||||||
const maxTopics = 4
|
const maxTopics = 4
|
||||||
|
|
||||||
|
// The maximum number of allowed topics within a topic criteria
|
||||||
|
const maxSubTopics = 1000
|
||||||
|
|
||||||
// filter is a helper struct that holds meta information over the filter type
|
// filter is a helper struct that holds meta information over the filter type
|
||||||
// and associated subscription in the event system.
|
// and associated subscription in the event system.
|
||||||
type filter struct {
|
type filter struct {
|
||||||
|
|
@ -562,7 +565,7 @@ func (args *FilterCriteria) UnmarshalJSON(data []byte) error {
|
||||||
|
|
||||||
case []interface{}:
|
case []interface{}:
|
||||||
// or case e.g. [null, "topic0", "topic1"]
|
// or case e.g. [null, "topic0", "topic1"]
|
||||||
if len(topic) > maxTopics {
|
if len(topic) > maxSubTopics {
|
||||||
return errExceedMaxTopics
|
return errExceedMaxTopics
|
||||||
}
|
}
|
||||||
for _, rawTopic := range topic {
|
for _, rawTopic := range topic {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue