misc fixes.
This commit is contained in:
parent
d1f05453bb
commit
07a4c3a465
@ -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);
|
||||
});
|
||||
|
||||
|
||||
@ -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');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user