diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-11 23:27:24 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-11 23:27:24 +0800 |
commit | 53ac85cfd3188f96bc595a131732bbdbd5d49687 (patch) | |
tree | 4b5cb1553d2b104cf153b364e6824eb7de182533 | |
parent | d465e410eff0ab255d0e427a8cf2f37ac10311da (diff) | |
download | dexon-53ac85cfd3188f96bc595a131732bbdbd5d49687.tar.gz dexon-53ac85cfd3188f96bc595a131732bbdbd5d49687.tar.zst dexon-53ac85cfd3188f96bc595a131732bbdbd5d49687.zip |
BlockHash must be a string
-rw-r--r-- | rpc/args.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rpc/args.go b/rpc/args.go index ff41e501f..26a61b1a1 100644 --- a/rpc/args.go +++ b/rpc/args.go @@ -40,7 +40,12 @@ func (args *GetBlockByHashArgs) UnmarshalJSON(b []byte) (err error) { if len(obj) < 1 { return errArguments } - args.BlockHash = obj[0].(string) + + argstr, ok := obj[0].(string) + if !ok { + return errDecodeArgs + } + args.BlockHash = argstr if len(obj) > 1 { args.Transactions = obj[1].(bool) |