diff options
Diffstat (limited to 'src/gui.cpp')
| -rw-r--r-- | src/gui.cpp | 10 |
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 | ||
| 27 | void MainFrameRepaint(); | 27 | void MainFrameRepaint(); |
| 28 | int GetDiscoveredPeerCount(); | 28 | int GetDiscoveredPeerCount(); |
| 29 | int GetPeerMedianHeight(); | ||
| 29 | string DateTimeStr(int64 nTime); | 30 | string DateTimeStr(int64 nTime); |
| 30 | bool SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew); | 31 | bool SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew); |
| 31 | int64 GetBalance(); | 32 | int64 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 | ||