diff --git a/lib/bcoin/peer.js b/lib/bcoin/peer.js index db99bbbf..3cdf3492 100644 --- a/lib/bcoin/peer.js +++ b/lib/bcoin/peer.js @@ -590,8 +590,6 @@ Peer.prototype._handleInv = function handleInv(items) { this.emit('txs', txs.map(function(tx) { return tx.hash; })); - - this.getData(txs); }; Peer.prototype._handleHeaders = function handleHeaders(headers) { diff --git a/lib/bcoin/pool.js b/lib/bcoin/pool.js index a292ec9e..ef9f131a 100644 --- a/lib/bcoin/pool.js +++ b/lib/bcoin/pool.js @@ -179,10 +179,6 @@ Pool.prototype._init = function _init() { self._handleTX(tx, peer); }); } - if (peer === self.peers.load) { - self._startInterval(); - self._startTimer(); - } }); this.chain.on('fork', function(block, data, peer) { @@ -275,7 +271,12 @@ Pool.prototype.resolveOrphan = function resolveOrphan(peer, top, orphan) { // If we're already processing the block // that would resolve this, ignore. - if (self.request.map[orphan.soil] || self.chain.hasPending(orphan.soil)) { + if (self.request.map[orphan.soil]) { + utils.debug('Already requested orphan "soil".'); + return; + } + + if (self.chain.hasPending(orphan.soil)) { utils.debug('Already processing orphan "soil".'); return; } @@ -442,6 +443,7 @@ Pool.prototype._addLoader = function _addLoader() { return; if (!self.syncing) return; + // If the peer sent us a block that was added // to the chain (not orphans), reset the timeout. self._handleBlock(block, peer, function(err, added) { @@ -460,6 +462,7 @@ Pool.prototype._addLoader = function _addLoader() { return; if (!self.syncing) return; + // If the peer sent us a block that was added // to the chain (not orphans), reset the timeout. self._handleBlock(block, peer, function(err, added) {