diff --git a/lib/daemon.js b/lib/daemon.js index bfc0ea6..af7372c 100644 --- a/lib/daemon.js +++ b/lib/daemon.js @@ -26,12 +26,12 @@ function DaemonInterface(options){ })(); - (function init(){ + function init(){ isOnline(function(online){ if (online) _this.emit('online'); }); - })(); + }; function isOnline(callback){ cmd('getinfo', [], function(error, result){ @@ -110,6 +110,7 @@ function DaemonInterface(options){ //public members + this.init = init; this.isOnline = isOnline; this.cmd = cmd; } diff --git a/lib/pool.js b/lib/pool.js index 22b476b..d7f508b 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -279,6 +279,8 @@ var pool = module.exports = function pool(options, authorizeFn){ }).on('error', function(message){ emitErrorLog('system', message); }); + + _this.daemon.init(); }