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:
parent
4bad017613
commit
eb8907e1a9
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user