misc fixes.

This commit is contained in:
Christopher Jeffrey 2016-02-24 02:37:38 -08:00
parent d1f05453bb
commit 07a4c3a465
2 changed files with 13 additions and 1 deletions

View File

@ -428,6 +428,8 @@ Pool.prototype._addLoader = function _addLoader() {
});
peer.on('merkleblock', function(block) {
if (!self.options.spv)
return;
if (!self.syncing)
return;
// If the peer sent us a block that was added
@ -444,6 +446,8 @@ Pool.prototype._addLoader = function _addLoader() {
});
peer.on('block', function(block) {
if (self.options.spv)
return;
if (!self.syncing)
return;
// If the peer sent us a block that was added
@ -898,10 +902,14 @@ Pool.prototype._addLeech = function _addLeech(socket) {
});
peer.on('merkleblock', function(block) {
if (!self.options.spv)
return;
self._handleBlock(block, peer);
});
peer.on('block', function(block) {
if (self.options.spv)
return;
self._handleBlock(block, peer);
});
@ -978,10 +986,14 @@ Pool.prototype._addPeer = function _addPeer() {
});
peer.on('merkleblock', function(block) {
if (!self.options.spv)
return;
self._handleBlock(block, peer);
});
peer.on('block', function(block) {
if (self.options.spv)
return;
self._handleBlock(block, peer);
});

View File

@ -75,7 +75,7 @@ function TX(data, block) {
}
TX.prototype.setBlock = function setBlock(block) {
this.network = block.network;
this.network = true;
this.relayedBy = block.relayedBy;
this.ts = block.ts;
this.block = block.hash('hex');