net: reduce request timeout to 2 min.
This commit is contained in:
parent
fa8b4c6428
commit
bc4a9b3f14
@ -2025,6 +2025,10 @@ Peer.prototype._handleInv = function _handleInv(packet) {
|
||||
if (txs.length > 0)
|
||||
this.emit('txs', txs);
|
||||
|
||||
this.logger.debug(
|
||||
'Received inv packet with %d items: blocks=%d txs=%d (%s).',
|
||||
items.length, blocks.length, txs.length, this.hostname);
|
||||
|
||||
if (unknown !== -1) {
|
||||
this.logger.warning(
|
||||
'Peer sent an unknown inv type: %d (%s).',
|
||||
@ -2041,6 +2045,10 @@ Peer.prototype._handleInv = function _handleInv(packet) {
|
||||
Peer.prototype._handleHeaders = function _handleHeaders(packet) {
|
||||
var headers = packet.items;
|
||||
|
||||
this.logger.debug(
|
||||
'Received headers packet with %d items (%s).',
|
||||
items.length, this.hostname);
|
||||
|
||||
if (headers.length > 2000) {
|
||||
this.setMisbehavior(100);
|
||||
return;
|
||||
|
||||
@ -138,7 +138,7 @@ function Pool(options) {
|
||||
|
||||
// Requested objects.
|
||||
this.requestMap = {};
|
||||
this.requestTimeout = 20 * 60000;
|
||||
this.requestTimeout = 2 * 60000;
|
||||
this.activeRequest = 0;
|
||||
this.activeBlocks = 0;
|
||||
this.activeTX = 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user