Skip to content

Commit

Permalink
adding method to get system fee by block to rpc server
Browse files Browse the repository at this point in the history
  • Loading branch information
localhuman authored and Erik Zhang committed Jul 25, 2017
1 parent f0ca8db commit ce1c77a
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion neo/Network/RPC/RpcServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ce1c77a

Please sign in to comment.