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
2ef044ed
Commit
2ef044ed
authored
Oct 29, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new bloom when filtering for topics
parent
cc67a84e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
bloom9_test.go
ethchain/bloom9_test.go
+1
-1
filter.go
ethchain/filter.go
+2
-5
No files found.
ethchain/bloom9_test.go
View file @
2ef044ed
...
...
@@ -8,7 +8,7 @@ import (
func
TestBloom9
(
t
*
testing
.
T
)
{
testCase
:=
[]
byte
(
"testtest"
)
bin
:=
LogsBloom
([]
vm
.
Log
{
vm
.
Log
{
testCase
,
nil
,
nil
}})
.
Bytes
()
bin
:=
LogsBloom
([]
vm
.
Log
{
vm
.
Log
{
testCase
,
[][]
byte
{[]
byte
(
"hellohello"
)}
,
nil
}})
.
Bytes
()
res
:=
BloomLookup
(
bin
,
testCase
)
if
!
res
{
...
...
ethchain/filter.go
View file @
2ef044ed
...
...
@@ -170,13 +170,10 @@ func (self *Filter) FilterMessages(msgs []*ethstate.Message) []*ethstate.Message
}
func
(
self
*
Filter
)
bloomFilter
(
block
*
Block
)
bool
{
// TODO update to the new bloom filter
bloom
:=
NewBloomFilter
(
nil
)
var
fromIncluded
,
toIncluded
bool
if
len
(
self
.
from
)
>
0
{
for
_
,
from
:=
range
self
.
from
{
if
bloom
.
Search
(
from
)
{
if
BloomLookup
(
block
.
LogsBloom
,
from
)
{
fromIncluded
=
true
break
}
...
...
@@ -187,7 +184,7 @@ func (self *Filter) bloomFilter(block *Block) bool {
if
len
(
self
.
to
)
>
0
{
for
_
,
to
:=
range
self
.
to
{
if
bloom
.
Search
(
to
)
{
if
BloomLookup
(
block
.
LogsBloom
,
to
)
{
toIncluded
=
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