diff options
| author | Ross Nicoll <[email protected]> | 2021-06-20 08:32:37 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-06-20 08:32:37 +0100 |
| commit | 760b9d05e650d2ecb7349b16b02bbec942d99a3d (patch) | |
| tree | 4b0e752ae86ce232a04ae0816b82cd1faae0aaa0 /src/net_processing.h | |
| parent | Merge pull request #1965 from rht/master (diff) | |
| parent | fix: Disconnect stalling peers after timeout of header sync (diff) | |
| download | discoin-760b9d05e650d2ecb7349b16b02bbec942d99a3d.tar.xz discoin-760b9d05e650d2ecb7349b16b02bbec942d99a3d.zip | |
Merge pull request #2306 from p-j01/1.14.4-dev-issue2282
[vulnerability] Disconnect stalling peers after timeout of header sync
Diffstat (limited to 'src/net_processing.h')
| -rw-r--r-- | src/net_processing.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/net_processing.h b/src/net_processing.h index 9e3f1b715..53ca5e393 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -17,7 +17,10 @@ static const int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60; static const int64_t ORPHAN_TX_EXPIRE_INTERVAL = 5 * 60; /** Default number of orphan+recently-replaced txn to keep around for block reconstruction */ static const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100; - +/** Headers download timeout expressed in microseconds + * Timeout = base + per_header * (expected number of headers) */ +static constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_BASE = 15 * 60 * 1000000; // 15 minutes +static constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER = 1000; // 1ms/header /** Register with a network node to receive its signals */ void RegisterNodeSignals(CNodeSignals& nodeSignals); /** Unregister a network node */ |