Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent exceed the height #92

Merged
merged 2 commits into from
May 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions CoreMetrics/CoreMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ namespace Neo.Plugins
{
public class CoreMetrics : Plugin, IRpcPlugin
{
public override void Configure()
{
}
public override void Configure() { }

public void PreProcess(HttpContext context, string method, JArray _params)
{
}
public void PreProcess(HttpContext context, string method, JArray _params) { }

public JObject OnProcess(HttpContext context, string method, JArray _params)
{
Expand All @@ -32,9 +28,7 @@ public JObject OnProcess(HttpContext context, string method, JArray _params)
}
}

public void PostProcess(HttpContext context, string method, JArray _params, JObject result)
{
}
public void PostProcess(HttpContext context, string method, JArray _params, JObject result) { }

private JObject GetBlocksTime(uint nBlocks, uint lastHeight)
{
Expand Down Expand Up @@ -79,6 +73,8 @@ private JObject GetBlocksTime(uint nBlocks, uint lastHeight)
{
JObject json = new JObject();
Header header = Blockchain.Singleton.Store.GetHeader(i);
if (header == null) break;

json["timestamp"] = header.Timestamp;
json["height"] = i;
array.Add(json);
Expand Down