diff options
Diffstat (limited to 'src/net.h')
| -rw-r--r-- | src/net.h | 19 |
1 files changed, 19 insertions, 0 deletions
| @@ -102,6 +102,25 @@ static const int BTF_PING_INTERVAL_SECS = 10 * 60; | |||
| 102 | static const int BTF_BEHIND_GRACE_SECS = 5 * 60; | 102 | static const int BTF_BEHIND_GRACE_SECS = 5 * 60; |
| 103 | static const int BTF_BEHIND_WARN_INTERVAL_SECS = 5 * 60; | 103 | static const int BTF_BEHIND_WARN_INTERVAL_SECS = 5 * 60; |
| 104 | 104 | ||
| 105 | // --- Self-diagnosis ------------------------------------------------------- | ||
| 106 | // | ||
| 107 | // A node that has stopped working looks exactly like a node with nothing to | ||
| 108 | // do. That has cost this project real time more than once: a node deaf to | ||
| 109 | // most of its peers, a miner allocating one RandomX dataset per thread, a | ||
| 110 | // third of arriving blocks missing their parent -- each was found from | ||
| 111 | // outside, by reading the process's sockets or its memory from another | ||
| 112 | // machine, because the node itself had no way to say so. | ||
| 113 | // | ||
| 114 | // These counters exist so it can. Cheap to keep, and they name the failures | ||
| 115 | // that actually happened rather than the ones that sound impressive. | ||
| 116 | extern int nPeersWatched; // peers in the last select() set | ||
| 117 | extern int64 nBlocksReceived; // blocks handed to ProcessBlock | ||
| 118 | extern int64 nBlocksWithoutParent; // ...of those, how many arrived orphaned | ||
| 119 | |||
| 120 | // One report, rendered the same way for the GUI panel and the log, so what a | ||
| 121 | // user pastes into an issue is what a developer already knows how to read. | ||
| 122 | string GetDiagnosticsText(); | ||
| 123 | |||
| 105 | // Defined in main.cpp. Declared here because CNode announces it in the version | 124 | // Defined in main.cpp. Declared here because CNode announces it in the version |
| 106 | // message, and net.h is included before main.h. | 125 | // message, and net.h is included before main.h. |
| 107 | extern int nBestHeight; | 126 | extern int nBestHeight; |