bitcoind: fix check reindex interval

This commit is contained in:
Braydon Fuller 2016-04-18 16:05:09 -04:00
parent bf67b932de
commit feb8038da6
2 changed files with 4 additions and 3 deletions

View File

@ -63,6 +63,7 @@ Bitcoin.dependencies = [];
Bitcoin.DEFAULT_MAX_ADDRESSES_QUERY = 10000;
Bitcoin.DEFAULT_TRY_ALL_INTERVAL = 1000;
Bitcoin.DEFAULT_REINDEX_INTERVAL = 10000;
Bitcoin.DEFAULT_START_RETRY_INTERVAL = 5000;
Bitcoin.DEFAULT_CONFIG_SETTINGS = {
server: 1,
@ -492,7 +493,7 @@ Bitcoin.prototype._checkReindex = function(node, callback) {
finish();
}
});
}, self._reindexWait);
}, node._reindexWait || Bitcoin.DEFAULT_REINDEX_INTERVAL);
} else {
callback();
}

View File

@ -730,9 +730,9 @@ describe('Bitcoin Service', function() {
});
it('give error from client getblockchaininfo', function(done) {
var bitcoind = new BitcoinService(baseConfig);
bitcoind._reindexWait = 1;
var node = {
_reindex: true,
_reindexWait: 1,
client: {
getBlockchainInfo: sinon.stub().callsArgWith(0, {code: -1 , message: 'Test error'})
}
@ -745,10 +745,10 @@ describe('Bitcoin Service', function() {
});
it('will wait until sync is 100 percent', function(done) {
var bitcoind = new BitcoinService(baseConfig);
bitcoind._reindexWait = 1;
var percent = 0.89;
var node = {
_reindex: true,
_reindexWait: 1,
client: {
getBlockchainInfo: function(callback) {
percent += 0.01;