From 0932f843830a30ea3da5d866fbe4e459d2748b1e Mon Sep 17 00:00:00 2001 From: Taylor Gerring Date: Fri, 13 Mar 2015 10:03:19 -0400 Subject: Fix eth_newBlockFilter --- rpc/args.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'rpc/args.go') diff --git a/rpc/args.go b/rpc/args.go index 8d4ad5967..b935c5007 100644 --- a/rpc/args.go +++ b/rpc/args.go @@ -503,7 +503,7 @@ type FilterStringArgs struct { } func (args *FilterStringArgs) UnmarshalJSON(b []byte) (err error) { - var obj []string + var obj []interface{} r := bytes.NewReader(b) if err := json.NewDecoder(r).Decode(&obj); err != nil { return NewDecodeParamError(err.Error()) @@ -513,7 +513,12 @@ func (args *FilterStringArgs) UnmarshalJSON(b []byte) (err error) { return NewInsufficientParamsError(len(obj), 1) } - args.Word = obj[0] + var argstr string + argstr, ok := obj[0].(string) + if !ok { + return NewDecodeParamError("Filter is not a string") + } + args.Word = argstr return nil } -- cgit