diff --git a/neo/Network/RPC/RpcServer.cs b/neo/Network/RPC/RpcServer.cs index 63b95af609..6f43140da5 100644 --- a/neo/Network/RPC/RpcServer.cs +++ b/neo/Network/RPC/RpcServer.cs @@ -104,7 +104,26 @@ protected virtual JObject Process(string method, JArray _params) case "getblockhash": { uint height = (uint)_params[0].AsNumber(); - return Blockchain.Default.GetBlockHash(height).ToString(); + if (height >= 0 && height <= Blockchain.Default.Height) + { + return Blockchain.Default.GetBlockHash(height).ToString(); + } + else + { + throw new RpcException(-100, "Invalid Height"); + } + } + case "getblocksysfee": + { + uint height = (uint)_params[0].AsNumber(); + if (height >= 0 && height <= Blockchain.Default.Height) + { + return Blockchain.Default.GetSysFeeAmount(height).ToString(); + } + else + { + throw new RpcException(-100, "Invalid Height"); + } } case "getconnectioncount": return LocalNode.RemoteNodeCount;