pool: change pool.options.satoshi to pool.options.relay.

This commit is contained in:
Christopher Jeffrey 2014-05-26 12:43:41 -05:00
parent a3b923ae76
commit 7e38e4de7c
2 changed files with 6 additions and 7 deletions

View File

@ -161,7 +161,7 @@ Peer.prototype.broadcast = function broadcast(items) {
};
Peer.prototype.updateWatch = function updateWatch() {
if (this.options.satoshi) {
if (!this.pool.options.relay) {
if (this.ack) {
var self = this;
if (this.pool.block.lastHash)
@ -430,7 +430,7 @@ Peer.prototype._handleInv = function handleInv(items) {
});
this.emit('blocks', blocks);
if (this.options.satoshi) {
if (!this.pool.options.relay) {
if (txs.length)
this.emit('txs', txs.map(function(tx) {
return tx.hash;

View File

@ -14,6 +14,7 @@ function Pool(options) {
this.options = options || {};
this.storage = this.options.storage;
this.options.relay = this.options.relay !== false;
this.destroyed = false;
this.size = options.size || 32;
this.parallel = options.parallel || 2000;
@ -105,8 +106,7 @@ Pool.prototype._addLoader = function _addLoader() {
return;
var peer = new bcoin.peer(this, this.createConnection, {
backoff: 750 * Math.random(),
satoshi: this.options.satoshi
backoff: 750 * Math.random()
});
this.peers.load = peer;
@ -243,8 +243,7 @@ Pool.prototype._addPeer = function _addPeer(backoff) {
return;
var peer = new bcoin.peer(this, this.createConnection, {
backoff: backoff,
satoshi: this.options.satoshi
backoff: backoff
});
this.peers.pending.push(peer);
@ -295,7 +294,7 @@ Pool.prototype._addPeer = function _addPeer(backoff) {
self.emit('block', block, peer);
});
if (this.options.satoshi) {
if (!this.options.relay) {
peer.on('block', function(block) {
peer.emit('merkleblock', block);
});