diff options
-rw-r--r-- | core/filter.go | 3 | ||||
-rw-r--r-- | rpc/args.go | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/core/filter.go b/core/filter.go index 4508b35b3..a924709f2 100644 --- a/core/filter.go +++ b/core/filter.go @@ -134,7 +134,8 @@ Logs: for i, topics := range self.topics { for _, topic := range topics { var match bool - if log.Topics[i] == topic { + // common.Hash{} is a match all (wildcard) + if (topic == common.Hash{}) || log.Topics[i] == topic { match = true } if !match { diff --git a/rpc/args.go b/rpc/args.go index 4b3840285..d03f914a7 100644 --- a/rpc/args.go +++ b/rpc/args.go @@ -739,10 +739,14 @@ func (args *BlockFilterArgs) UnmarshalJSON(b []byte) (err error) { for j, jv := range argarray { if v, ok := jv.(string); ok { topicdbl[i][j] = v + } else if jv == nil { + topicdbl[i][j] = "" } else { return NewInvalidTypeError(fmt.Sprintf("topic[%d][%d]", i, j), "is not a string") } } + } else if iv == nil { + topicdbl[i] = []string{""} } else { return NewInvalidTypeError(fmt.Sprintf("topic[%d]", i), "not a string or array") } |