diff --git a/example/index.js b/example/index.js index 3ee211c7..b1db8701 100755 --- a/example/index.js +++ b/example/index.js @@ -1,5 +1,7 @@ #!/usr/bin/env node +'use strict'; + /** * bitcoind.js example */ @@ -9,10 +11,9 @@ process.title = 'bitcoind.js'; /** * bitcoind */ -var bitcoindjsConf = process.env('BITCOINDJS_DIR'); var bitcoind = require('../')({ - directory: '~/.libbitcoind-example' + directory: process.env.BITCOINDJS_DIR || '~/.bitcoin' }); bitcoind.on('error', function(err) { diff --git a/lib/bitcoind.js b/lib/bitcoind.js index 9430d81e..ce32f74d 100644 --- a/lib/bitcoind.js +++ b/lib/bitcoind.js @@ -196,7 +196,8 @@ Bitcoin.prototype.start = function(options, callback) { bitcoindjs.start(options, function(err, status) { self._started = true; - // Poll for queued packet [sigint, sighup, sigquit].forEach(function(signal) { + // Poll for queued packet + [sigint, sighup, sigquit].forEach(function(signal) { process.on(signal.name, signal.listener = function() { if (process.listeners(signal.name).length > 1) { return;