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){
|
||||
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;
|
||||
}
|
||||
|
||||
@ -279,6 +279,8 @@ var pool = module.exports = function pool(options, authorizeFn){
|
||||
}).on('error', function(message){
|
||||
emitErrorLog('system', message);
|
||||
});
|
||||
|
||||
_this.daemon.init();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user