pool: increase max header chain failures.
This commit is contained in:
parent
f6cb0f1a19
commit
fb997d43bb
@ -119,6 +119,15 @@ function Pool(options) {
|
||||
|
||||
util.inherits(Pool, AsyncObject);
|
||||
|
||||
/**
|
||||
* Max number of header chain failures
|
||||
* before disabling checkpoints.
|
||||
* @const {Number}
|
||||
* @default
|
||||
*/
|
||||
|
||||
Pool.MAX_HEADER_FAILS = 500;
|
||||
|
||||
/**
|
||||
* Initialize the pool.
|
||||
* @private
|
||||
@ -1827,7 +1836,7 @@ Pool.prototype._handleHeaders = co(function* handleHeaders(peer, packet) {
|
||||
'Peer sent a bad header chain (%s).',
|
||||
peer.hostname());
|
||||
|
||||
if (++this.headerFails < 4) {
|
||||
if (++this.headerFails < Pool.MAX_HEADER_FAILS) {
|
||||
peer.destroy();
|
||||
return;
|
||||
}
|
||||
@ -1848,7 +1857,7 @@ Pool.prototype._handleHeaders = co(function* handleHeaders(peer, packet) {
|
||||
'Peer sent an invalid checkpoint (%s).',
|
||||
peer.hostname());
|
||||
|
||||
if (++this.headerFails < 4) {
|
||||
if (++this.headerFails < Pool.MAX_HEADER_FAILS) {
|
||||
peer.destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user