diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-30 03:33:25 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-30 03:33:25 +0800 |
commit | 2ef044edfca1afcb0e3185f32d5e4c7cce72153a (patch) | |
tree | 0c72b16cc5052c9d0cab2308d486220f958bb404 | |
parent | cc67a84e945ba914d8e4981106d3c75c91c00db0 (diff) | |
download | dexon-2ef044edfca1afcb0e3185f32d5e4c7cce72153a.tar dexon-2ef044edfca1afcb0e3185f32d5e4c7cce72153a.tar.gz dexon-2ef044edfca1afcb0e3185f32d5e4c7cce72153a.tar.bz2 dexon-2ef044edfca1afcb0e3185f32d5e4c7cce72153a.tar.lz dexon-2ef044edfca1afcb0e3185f32d5e4c7cce72153a.tar.xz dexon-2ef044edfca1afcb0e3185f32d5e4c7cce72153a.tar.zst dexon-2ef044edfca1afcb0e3185f32d5e4c7cce72153a.zip |
Use new bloom when filtering for topics
-rw-r--r-- | ethchain/bloom9_test.go | 2 | ||||
-rw-r--r-- | ethchain/filter.go | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/ethchain/bloom9_test.go b/ethchain/bloom9_test.go index ab648b7fc..40f30f35d 100644 --- a/ethchain/bloom9_test.go +++ b/ethchain/bloom9_test.go @@ -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 { diff --git a/ethchain/filter.go b/ethchain/filter.go index 55d7072e2..b0edea7a0 100644 --- a/ethchain/filter.go +++ b/ethchain/filter.go @@ -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 } |