fixed #12 JobManager's newBlock event never gets emitted

The `init` function does not auto-execute anymore. It is instead added as a public member for `DaemonInterface` and called by `Pool.SetupDaemonInterface`.
This commit is contained in:
Brice Carpentier 2014-02-27 10:27:43 +01:00
parent 4bad017613
commit eb8907e1a9
2 changed files with 5 additions and 2 deletions

View File

@ -26,12 +26,12 @@ function DaemonInterface(options){
})(); })();
(function init(){ function init(){
isOnline(function(online){ isOnline(function(online){
if (online) if (online)
_this.emit('online'); _this.emit('online');
}); });
})(); };
function isOnline(callback){ function isOnline(callback){
cmd('getinfo', [], function(error, result){ cmd('getinfo', [], function(error, result){
@ -110,6 +110,7 @@ function DaemonInterface(options){
//public members //public members
this.init = init;
this.isOnline = isOnline; this.isOnline = isOnline;
this.cmd = cmd; this.cmd = cmd;
} }

View File

@ -279,6 +279,8 @@ var pool = module.exports = function pool(options, authorizeFn){
}).on('error', function(message){ }).on('error', function(message){
emitErrorLog('system', message); emitErrorLog('system', message);
}); });
_this.daemon.init();
} }