From 4f8e401dbc21ccfb85ef6e303125b82cae260931 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 22 Dec 2016 04:01:49 -0800 Subject: [PATCH] peer: cleanup events after connect timeout. --- lib/net/peer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/net/peer.js b/lib/net/peer.js index d39c184b..60a3aad7 100644 --- a/lib/net/peer.js +++ b/lib/net/peer.js @@ -390,6 +390,7 @@ Peer.prototype.initConnect = function initConnect() { self.connectTimeout = setTimeout(function() { self.connectTimeout = null; + cleanup(); reject(new Error('Connection timed out.')); }, 10000); }); @@ -621,7 +622,7 @@ Peer.prototype.isLoader = function isLoader() { /** * Broadcast blocks to peer. - * @param {AbstractBlock[]} blocks + * @param {Block[]} blocks */ Peer.prototype.announceBlock = function announceBlock(blocks) { @@ -707,6 +708,7 @@ Peer.prototype.announceTX = function announceTX(txs) { continue; } + // Check the fee filter. if (this.feeRate !== -1 && this.mempool) { hash = tx.hash('hex'); entry = this.mempool.getEntry(hash);