bitcoind: fix clearInterval issue with Node.js 0.12

This commit is contained in:
Braydon Fuller 2016-04-19 20:27:52 -04:00
parent 40e7b24ea9
commit c3dab07b30
2 changed files with 5 additions and 2 deletions

View File

@ -470,12 +470,15 @@ Bitcoin.prototype._checkSyncedAndSubscribeZmqEvents = function(node) {
}
if (!synced) {
interval = setInterval(function() {
if (self.node.stopping) {
return clearInterval(interval);
}
checkAndSubscribe(function(err) {
if (err) {
log.error(err);
}
});
}, node._tipUpdateInterval || Bitcoin.DEFAULT_TIP_UPDATE_INTERVAL).unref();
}, node._tipUpdateInterval || Bitcoin.DEFAULT_TIP_UPDATE_INTERVAL);
}
});

View File

@ -720,7 +720,7 @@ describe('Bitcoin Service', function() {
bitcoind._updateTip.callCount.should.equal(10);
bitcoind._subscribeZmqEvents.callCount.should.equal(1);
done();
}, 20);
}, 40);
});
});