|
|
@ -16,7 +16,7 @@ type FilterOptions struct { |
|
|
|
Earliest int64 |
|
|
|
Earliest int64 |
|
|
|
Latest int64 |
|
|
|
Latest int64 |
|
|
|
|
|
|
|
|
|
|
|
Address []byte |
|
|
|
Address [][]byte |
|
|
|
Topics [][]byte |
|
|
|
Topics [][]byte |
|
|
|
|
|
|
|
|
|
|
|
Skip int |
|
|
|
Skip int |
|
|
@ -29,7 +29,7 @@ type Filter struct { |
|
|
|
earliest int64 |
|
|
|
earliest int64 |
|
|
|
latest int64 |
|
|
|
latest int64 |
|
|
|
skip int |
|
|
|
skip int |
|
|
|
address []byte |
|
|
|
address [][]byte |
|
|
|
max int |
|
|
|
max int |
|
|
|
topics [][]byte |
|
|
|
topics [][]byte |
|
|
|
|
|
|
|
|
|
|
@ -65,7 +65,7 @@ func (self *Filter) SetLatestBlock(latest int64) { |
|
|
|
self.latest = latest |
|
|
|
self.latest = latest |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (self *Filter) SetAddress(addr []byte) { |
|
|
|
func (self *Filter) SetAddress(addr [][]byte) { |
|
|
|
self.address = addr |
|
|
|
self.address = addr |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -145,7 +145,8 @@ func (self *Filter) FilterLogs(logs state.Logs) state.Logs { |
|
|
|
// Filter the logs for interesting stuff
|
|
|
|
// Filter the logs for interesting stuff
|
|
|
|
Logs: |
|
|
|
Logs: |
|
|
|
for _, log := range logs { |
|
|
|
for _, log := range logs { |
|
|
|
if !bytes.Equal(self.address, log.Address()) { |
|
|
|
if !includes(self.address, log.Address()) { |
|
|
|
|
|
|
|
//if !bytes.Equal(self.address, log.Address()) {
|
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -163,8 +164,18 @@ Logs: |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (self *Filter) bloomFilter(block *types.Block) bool { |
|
|
|
func (self *Filter) bloomFilter(block *types.Block) bool { |
|
|
|
if len(self.address) > 0 && !types.BloomLookup(block.Bloom(), self.address) { |
|
|
|
if len(self.address) > 0 { |
|
|
|
return false |
|
|
|
var included bool |
|
|
|
|
|
|
|
for _, addr := range self.address { |
|
|
|
|
|
|
|
if types.BloomLookup(block.Bloom(), addr) { |
|
|
|
|
|
|
|
included = true |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if !included { |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for _, topic := range self.topics { |
|
|
|
for _, topic := range self.topics { |
|
|
|