@@ -34,8 +34,8 @@ type Filter struct {
34
34
addresses []common.Address
35
35
topics [][]common.Hash
36
36
37
- block common.Hash // Block hash if filtering a single block
38
- begin , end int64 // Range interval if filtering multiple blocks
37
+ block * common.Hash // Block hash if filtering a single block
38
+ begin , end int64 // Range interval if filtering multiple blocks
39
39
40
40
matcher * bloombits.Matcher
41
41
}
@@ -78,7 +78,7 @@ func (sys *FilterSystem) NewRangeFilter(begin, end int64, addresses []common.Add
78
78
func (sys * FilterSystem ) NewBlockFilter (block common.Hash , addresses []common.Address , topics [][]common.Hash ) * Filter {
79
79
// Create a generic filter and convert it into a block filter
80
80
filter := newFilter (sys , addresses , topics )
81
- filter .block = block
81
+ filter .block = & block
82
82
return filter
83
83
}
84
84
@@ -96,8 +96,8 @@ func newFilter(sys *FilterSystem, addresses []common.Address, topics [][]common.
96
96
// first block that contains matches, updating the start of the filter accordingly.
97
97
func (f * Filter ) Logs (ctx context.Context ) ([]* types.Log , error ) {
98
98
// If we're doing singleton block filtering, execute and return
99
- if f .block != (common. Hash {}) {
100
- header , err := f .sys .backend .HeaderByHash (ctx , f .block )
99
+ if f .block != nil {
100
+ header , err := f .sys .backend .HeaderByHash (ctx , * f .block )
101
101
if err != nil {
102
102
return nil , err
103
103
}
0 commit comments