diff --git a/neo-cli/CLI/MainService.Node.cs b/neo-cli/CLI/MainService.Node.cs
index a830f8eb7..0dd438c20 100644
--- a/neo-cli/CLI/MainService.Node.cs
+++ b/neo-cli/CLI/MainService.Node.cs
@@ -69,8 +69,11 @@ private void OnShowStateCommand()
while (!cancel.Token.IsCancellationRequested)
{
+ uint height = NativeContract.Ledger.CurrentIndex(Blockchain.Singleton.View);
+ uint headerHeight = Blockchain.Singleton.HeaderCache.Last?.Index ?? height;
+
Console.SetCursorPosition(0, 0);
- WriteLineWithoutFlicker($"block: {NativeContract.Ledger.CurrentIndex(Blockchain.Singleton.View)} connected: {LocalNode.Singleton.ConnectedCount} unconnected: {LocalNode.Singleton.UnconnectedCount}", Console.WindowWidth - 1);
+ WriteLineWithoutFlicker($"block: {height}/{headerHeight} connected: {LocalNode.Singleton.ConnectedCount} unconnected: {LocalNode.Singleton.UnconnectedCount}", Console.WindowWidth - 1);
int linesWritten = 1;
foreach (RemoteNode node in LocalNode.Singleton.GetRemoteNodes().OrderByDescending(u => u.LastBlockIndex).Take(Console.WindowHeight - 2).ToArray())
diff --git a/neo-cli/neo-cli.csproj b/neo-cli/neo-cli.csproj
index c04610e92..16a7572b0 100644
--- a/neo-cli/neo-cli.csproj
+++ b/neo-cli/neo-cli.csproj
@@ -28,7 +28,7 @@
-
+
diff --git a/neo-gui/GUI/MainForm.cs b/neo-gui/GUI/MainForm.cs
index 738653fd9..38aa947a6 100644
--- a/neo-gui/GUI/MainForm.cs
+++ b/neo-gui/GUI/MainForm.cs
@@ -150,7 +150,7 @@ private void RefreshConfirmations()
foreach (ListViewItem item in listView3.Items)
{
uint? height = item.Tag as uint?;
- int? confirmations = (int)Blockchain.Singleton.Height - (int?)height + 1;
+ int? confirmations = (int)NativeContract.Ledger.CurrentIndex(Blockchain.Singleton.View) - (int?)height + 1;
if (confirmations <= 0) confirmations = null;
item.SubItems["confirmations"].Text = confirmations?.ToString() ?? Strings.Unconfirmed;
}
@@ -171,8 +171,10 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
private void timer1_Tick(object sender, EventArgs e)
{
- lbl_height.Text = Blockchain.Singleton.Height.ToString();
+ uint height = NativeContract.Ledger.CurrentIndex(Blockchain.Singleton.View);
+ uint headerHeight = Blockchain.Singleton.HeaderCache.Last?.Index ?? height;
+ lbl_height.Text = $"{height}/{headerHeight}";
lbl_count_node.Text = LocalNode.Singleton.ConnectedCount.ToString();
TimeSpan persistence_span = DateTime.UtcNow - persistence_time;
if (persistence_span < TimeSpan.Zero) persistence_span = TimeSpan.Zero;
diff --git a/neo-gui/GUI/MainForm.resx b/neo-gui/GUI/MainForm.resx
index 3a532b89f..21c7f5a2b 100644
--- a/neo-gui/GUI/MainForm.resx
+++ b/neo-gui/GUI/MainForm.resx
@@ -521,7 +521,7 @@
27, 17
- 0
+ 0/0
73, 17