upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui.cpp')
-rw-r--r--src/gui.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui.cpp b/src/gui.cpp
index 825202b..28f5ffa 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -26,6 +26,7 @@ extern CAddress addrLocalHost;
26 26
27void MainFrameRepaint(); 27void MainFrameRepaint();
28int GetDiscoveredPeerCount(); 28int GetDiscoveredPeerCount();
29int GetPeerMedianHeight();
29string DateTimeStr(int64 nTime); 30string DateTimeStr(int64 nTime);
30bool SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew); 31bool SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew);
31int64 GetBalance(); 32int64 GetBalance();
@@ -238,6 +239,15 @@ static void DrawStatusBar()
238 connected, discovered, nBestHeight); 239 connected, discovered, nBestHeight);
239 } 240 }
240 241
242 // A node that has stopped receiving looks exactly like one with nothing to
243 // do. Now that peers announce their height, say the difference out loud
244 // instead of leaving the user to guess from a number that stopped moving.
245 int peerHeight = GetPeerMedianHeight();
246 if (peerHeight >= 0 && nBestHeight < peerHeight - 1)
247 ImGui::TextColored(ImVec4(0.95f, 0.65f, 0.20f, 1.0f),
248 "Behind the network by %d block(s) -- peers report height %d",
249 peerHeight - nBestHeight, peerHeight);
250
241 ImGui::End(); 251 ImGui::End();
242} 252}
243 253