peer: cleanup events after connect timeout.

This commit is contained in:
Christopher Jeffrey 2016-12-22 04:01:49 -08:00
parent bb11cfc021
commit 4f8e401dbc
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -390,6 +390,7 @@ Peer.prototype.initConnect = function initConnect() {
self.connectTimeout = setTimeout(function() { self.connectTimeout = setTimeout(function() {
self.connectTimeout = null; self.connectTimeout = null;
cleanup();
reject(new Error('Connection timed out.')); reject(new Error('Connection timed out.'));
}, 10000); }, 10000);
}); });
@ -621,7 +622,7 @@ Peer.prototype.isLoader = function isLoader() {
/** /**
* Broadcast blocks to peer. * Broadcast blocks to peer.
* @param {AbstractBlock[]} blocks * @param {Block[]} blocks
*/ */
Peer.prototype.announceBlock = function announceBlock(blocks) { Peer.prototype.announceBlock = function announceBlock(blocks) {
@ -707,6 +708,7 @@ Peer.prototype.announceTX = function announceTX(txs) {
continue; continue;
} }
// Check the fee filter.
if (this.feeRate !== -1 && this.mempool) { if (this.feeRate !== -1 && this.mempool) {
hash = tx.hash('hex'); hash = tx.hash('hex');
entry = this.mempool.getEntry(hash); entry = this.mempool.getEntry(hash);