Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
c8e21a4d
Commit
c8e21a4d
authored
Apr 24, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #803 from obscuren/log_filter_fixes
core: fixed wildcard topic filters. Closes #725
parents
168ff366
cd2782f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
filter.go
core/filter.go
+14
-5
No files found.
core/filter.go
View file @
c8e21a4d
...
...
@@ -131,17 +131,26 @@ Logs:
logTopics
:=
make
([]
common
.
Hash
,
len
(
self
.
topics
))
copy
(
logTopics
,
log
.
Topics
)
// If the to filtered topics is greater than the amount of topics in
// logs, skip.
if
len
(
self
.
topics
)
>
len
(
log
.
Topics
)
{
continue
Logs
}
for
i
,
topics
:=
range
self
.
topics
{
var
match
bool
for
_
,
topic
:=
range
topics
{
var
match
bool
// common.Hash{} is a match all (wildcard)
if
(
topic
==
common
.
Hash
{})
||
log
.
Topics
[
i
]
==
topic
{
match
=
true
}
if
!
match
{
continue
Logs
break
}
}
if
!
match
{
continue
Logs
}
}
ret
=
append
(
ret
,
log
)
...
...
@@ -168,7 +177,7 @@ func (self *Filter) bloomFilter(block *types.Block) bool {
for
_
,
sub
:=
range
self
.
topics
{
var
included
bool
for
_
,
topic
:=
range
sub
{
if
types
.
BloomLookup
(
block
.
Bloom
(),
topic
)
{
if
(
topic
==
common
.
Hash
{})
||
types
.
BloomLookup
(
block
.
Bloom
(),
topic
)
{
included
=
true
break
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment