diff --git a/lib/services/bitcoind.js b/lib/services/bitcoind.js index 4e96d2ea..53bc6c72 100644 --- a/lib/services/bitcoind.js +++ b/lib/services/bitcoind.js @@ -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(); } diff --git a/test/services/bitcoind.unit.js b/test/services/bitcoind.unit.js index 50ef9a5d..dccfddb1 100644 --- a/test/services/bitcoind.unit.js +++ b/test/services/bitcoind.unit.js @@ -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;