comments. remove useless variable.
This commit is contained in:
parent
9976208d0d
commit
ff16271c1a
@ -354,6 +354,7 @@ Pool.prototype._handleBlock = function _handleBlock(block, peer) {
|
|||||||
if (!this.options.fullNode)
|
if (!this.options.fullNode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Emulate bip37 - emit all the "watched" txs
|
||||||
if (this.listeners('watched').length > 0) {
|
if (this.listeners('watched').length > 0) {
|
||||||
utils.nextTick(function() {
|
utils.nextTick(function() {
|
||||||
block.txs.forEach(function(tx) {
|
block.txs.forEach(function(tx) {
|
||||||
@ -363,8 +364,6 @@ Pool.prototype._handleBlock = function _handleBlock(block, peer) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
backoff = 0;
|
|
||||||
|
|
||||||
this._response(block);
|
this._response(block);
|
||||||
|
|
||||||
hash = block.hash('hex');
|
hash = block.hash('hex');
|
||||||
@ -378,12 +377,18 @@ Pool.prototype._handleBlock = function _handleBlock(block, peer) {
|
|||||||
this.emit('_block', block, peer);
|
this.emit('_block', block, peer);
|
||||||
|
|
||||||
if (this.chain.hasOrphan(block)) {
|
if (this.chain.hasOrphan(block)) {
|
||||||
peer.loadBlocks(this.chain.locatorHashes(), this.chain.getOrphanRoot(block));
|
// Resolve orphan chain
|
||||||
|
peer.loadBlocks(
|
||||||
|
this.chain.locatorHashes(),
|
||||||
|
this.chain.getOrphanRoot(block)
|
||||||
|
);
|
||||||
|
// Emit our orphan if it is new
|
||||||
if (!orphan)
|
if (!orphan)
|
||||||
this.emit('orphan', block, peer);
|
this.emit('orphan', block, peer);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not emit if nothing was added to the chain
|
||||||
if (this.chain.size() === size)
|
if (this.chain.size() === size)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user