orphan soil. misc.

This commit is contained in:
Christopher Jeffrey 2016-02-28 19:15:15 -08:00
parent d6e7ca0660
commit 7829ff3bea
2 changed files with 8 additions and 7 deletions

View File

@ -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) {

View File

@ -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) {