From 9aa1e9b8f18220c0f03d265a71c35573903a860c Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 3 May 2016 12:45:56 -0700 Subject: [PATCH] minor. --- lib/bcoin/protocol/network.js | 9 ++++++--- lib/bcoin/tx.js | 5 ++--- lib/bcoin/workers.js | 11 +++++++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/bcoin/protocol/network.js b/lib/bcoin/protocol/network.js index edfebdb2..983466a6 100644 --- a/lib/bcoin/protocol/network.js +++ b/lib/bcoin/protocol/network.js @@ -577,7 +577,8 @@ regtest.alertPrivateKey = new Buffer( 'hex'); regtest.alertKey = new Buffer( - '032b7c336bc802421f38063251a6230cc3cd3a9c4282d1673fbb037a4fd4f7408c', 'hex'); + '032b7c336bc802421f38063251a6230cc3cd3a9c4282d1673fbb037a4fd4f7408c', + 'hex'); regtest.checkpoints = {}; regtest.checkpoints.tsLastCheckpoint = 0; @@ -704,7 +705,8 @@ segnet3.magic = 0xcaea962e; segnet3.port = 28333; segnet3.alertKey = new Buffer( - '0300000000000000000000003b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63', 'hex'); + '0300000000000000000000003b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63', + 'hex'); segnet3.checkpoints = {}; segnet3.checkpoints.tsLastCheckpoint = 0; @@ -812,7 +814,8 @@ segnet4.magic = 0xc4a1abdc; segnet4.port = 28901; segnet4.alertKey = new Buffer( - '0300000000000000000000003b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63', 'hex'); + '0300000000000000000000003b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63', + 'hex'); segnet4.checkpoints = {}; segnet4.checkpoints.tsLastCheckpoint = 0; diff --git a/lib/bcoin/tx.js b/lib/bcoin/tx.js index cf407063..a187dcf6 100644 --- a/lib/bcoin/tx.js +++ b/lib/bcoin/tx.js @@ -586,11 +586,10 @@ TX.prototype.verify = function verify(index, force, flags) { flags ); } catch (e) { - if (e.type === 'ScriptError') { + if (e.type === 'ScriptError') bcoin.debug('Script verification error: %s', e.message); - } else { + else bcoin.debug('Script interpreter threw: %s', e.stack + ''); - } return false; } } diff --git a/lib/bcoin/workers.js b/lib/bcoin/workers.js index bf193dce..0399a9cd 100644 --- a/lib/bcoin/workers.js +++ b/lib/bcoin/workers.js @@ -115,7 +115,7 @@ Workers.prototype.alloc = function alloc(job) { */ Workers.prototype.execute = function execute(method, args, timeout, callback) { - var job = this.uid; + var job = this.uid++; var child; if (job > 0xffffffff) { @@ -123,9 +123,12 @@ Workers.prototype.execute = function execute(method, args, timeout, callback) { job = this.uid++; } + if (!timeout) + timeout = this.timeout; + child = this.alloc(job); - child.execute(job, method, args, timeout || this.timeout, callback); + child.execute(job, method, args, timeout, callback); return child; }; @@ -289,7 +292,7 @@ Worker.prototype.send = function send(job, name, items) { Worker.prototype.sendEvent = function sendEvent() { var items = Array.prototype.slice.call(arguments); - return this.write(this.framer.packet(0, 'event', items)); + return this.send(0, 'event', items); }; /** @@ -439,7 +442,7 @@ Master.prototype.send = function send(job, name, items) { Master.prototype.sendEvent = function sendEvent() { var items = Array.prototype.slice.call(arguments); - return this.write(this.framer.packet(0, 'event', items)); + return this.send(0, 'event', items); }; /**