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