Skip to content

Commit 2ef044e

Browse files
committed
Use new bloom when filtering for topics
1 parent cc67a84 commit 2ef044e

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

‎ethchain/bloom9_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
func TestBloom9(t *testing.T) {
1010
testCase := []byte("testtest")
11-
bin := LogsBloom([]vm.Log{vm.Log{testCase, nil, nil}}).Bytes()
11+
bin := LogsBloom([]vm.Log{vm.Log{testCase, [][]byte{[]byte("hellohello")}, nil}}).Bytes()
1212
res := BloomLookup(bin, testCase)
1313

1414
if !res {

‎ethchain/filter.go‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,10 @@ func (self *Filter) FilterMessages(msgs []*ethstate.Message) []*ethstate.Message
170170
}
171171

172172
func (self *Filter) bloomFilter(block *Block) bool {
173-
// TODO update to the new bloom filter
174-
bloom := NewBloomFilter(nil)
175-
176173
var fromIncluded, toIncluded bool
177174
if len(self.from) > 0 {
178175
for _, from := range self.from {
179-
if bloom.Search(from) {
176+
if BloomLookup(block.LogsBloom, from) {
180177
fromIncluded = true
181178
break
182179
}
@@ -187,7 +184,7 @@ func (self *Filter) bloomFilter(block *Block) bool {
187184

188185
if len(self.to) > 0 {
189186
for _, to := range self.to {
190-
if bloom.Search(to) {
187+
if BloomLookup(block.LogsBloom, to) {
191188
toIncluded = true
192189
break
193190
}

0 commit comments

Comments
 (0)