From bbf9386b07f959ec4da7be64a4ed535b13ef86bc Mon Sep 17 00:00:00 2001 From: erikzhang Date: Wed, 13 Mar 2019 16:21:40 +0800 Subject: [PATCH] Fixes #635 --- neo/Network/RPC/RpcServer.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/neo/Network/RPC/RpcServer.cs b/neo/Network/RPC/RpcServer.cs index 467ba6c709..faf8778fdb 100644 --- a/neo/Network/RPC/RpcServer.cs +++ b/neo/Network/RPC/RpcServer.cs @@ -140,7 +140,7 @@ private JObject Process(string method, JArray _params) } case "getblockhash": { - uint height = (uint)_params[0].AsNumber(); + uint height = uint.Parse(_params[0].AsString()); return GetBlockHash(height); } case "getblockheader": @@ -151,7 +151,7 @@ private JObject Process(string method, JArray _params) } case "getblocksysfee": { - uint height = (uint)_params[0].AsNumber(); + uint height = uint.Parse(_params[0].AsString()); return GetBlockSysFee(height); } case "getconnectioncount": @@ -192,7 +192,7 @@ private JObject Process(string method, JArray _params) case "gettxout": { UInt256 hash = UInt256.Parse(_params[0].AsString()); - ushort index = (ushort)_params[1].AsNumber(); + ushort index = ushort.Parse(_params[1].AsString()); return GetTxOut(hash, index); } case "getvalidators": @@ -416,7 +416,7 @@ private JObject GetBlock(JObject key, bool verbose) Block block; if (key is JNumber) { - uint index = (uint)key.AsNumber(); + uint index = uint.Parse(key.AsString()); block = Blockchain.Singleton.Store.GetBlock(index); } else @@ -457,7 +457,7 @@ private JObject GetBlockHeader(JObject key, bool verbose) Header header; if (key is JNumber) { - uint height = (uint)key.AsNumber(); + uint height = uint.Parse(key.AsString()); header = Blockchain.Singleton.Store.GetHeader(height); } else