aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'rpc')
-rw-r--r--rpc/args.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/rpc/args.go b/rpc/args.go
index a8cb7dcb1..cebabf4ba 100644
--- a/rpc/args.go
+++ b/rpc/args.go
@@ -41,7 +41,11 @@ func blockHeight(raw interface{}, number *int64) error {
case "pending":
*number = -2
default:
- *number = common.String2Big(str).Int64()
+ if common.HasHexPrefix(str) {
+ *number = common.String2Big(str).Int64()
+ } else {
+ return NewInvalidTypeError("blockNumber", "is not a valid string")
+ }
}
return nil