diff options
Diffstat (limited to 'src/net.h')
| -rw-r--r-- | src/net.h | 8 |
1 files changed, 8 insertions, 0 deletions
| @@ -120,6 +120,13 @@ static const unsigned int MAX_CONNECTIONS = 125; | |||
| 120 | // this long regardless of what is still buffered. | 120 | // this long regardless of what is still buffered. |
| 121 | static const int64 DISCONNECT_DRAIN_SECS = 60; | 121 | static const int64 DISCONNECT_DRAIN_SECS = 60; |
| 122 | 122 | ||
| 123 | // How long a pool may go without hearing a height from ANY peer before it | ||
| 124 | // stops issuing jobs. Long enough that ordinary peer churn and a quiet | ||
| 125 | // handshake window do not trip it; short enough that a deaf pool cannot build | ||
| 126 | // more than a few blocks of private fork before it is stopped. Heights | ||
| 127 | // 3966-4085 -- 120 blocks, 5890.50 BTF -- were mined in exactly this state. | ||
| 128 | static const int64 BTF_NO_PEER_HEIGHT_MAX_SECS = 20 * 60; | ||
| 129 | |||
| 123 | // Send a ping after this long with nothing to say, so a peer running the | 130 | // Send a ping after this long with nothing to say, so a peer running the |
| 124 | // inactivity check above does not mistake a quiet node for a dead one. Must | 131 | // inactivity check above does not mistake a quiet node for a dead one. Must |
| 125 | // stay well under BTF_RECV_TIMEOUT_SECS. | 132 | // stay well under BTF_RECV_TIMEOUT_SECS. |
| @@ -160,6 +167,7 @@ extern int nBestHeight; | |||
| 160 | // has told us anything. Median rather than maximum so one peer claiming an | 167 | // has told us anything. Median rather than maximum so one peer claiming an |
| 161 | // absurd height cannot move it. | 168 | // absurd height cannot move it. |
| 162 | int GetPeerMedianHeight(); | 169 | int GetPeerMedianHeight(); |
| 170 | int64 GetPeerHeightAgeSecs(); | ||
| 163 | 171 | ||
| 164 | // Lightweight .btf churn accounting. These counters are diagnostics only: they | 172 | // Lightweight .btf churn accounting. These counters are diagnostics only: they |
| 165 | // let an operator tell stale descriptors, relay pairing failures, and paired | 173 | // let an operator tell stale descriptors, relay pairing failures, and paired |