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_MAX_ADDRESSES_QUERY = 10000;
Bitcoin.DEFAULT_TRY_ALL_INTERVAL = 1000; Bitcoin.DEFAULT_TRY_ALL_INTERVAL = 1000;
Bitcoin.DEFAULT_REINDEX_INTERVAL = 10000;
Bitcoin.DEFAULT_START_RETRY_INTERVAL = 5000; Bitcoin.DEFAULT_START_RETRY_INTERVAL = 5000;
Bitcoin.DEFAULT_CONFIG_SETTINGS = { Bitcoin.DEFAULT_CONFIG_SETTINGS = {
server: 1, server: 1,
@ -492,7 +493,7 @@ Bitcoin.prototype._checkReindex = function(node, callback) {
finish(); finish();
} }
}); });
}, self._reindexWait); }, node._reindexWait || Bitcoin.DEFAULT_REINDEX_INTERVAL);
} else { } else {
callback(); callback();
} }

View File

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