Skip to content

Commit

Permalink
Merge pull request #32 from Samourai-Wallet/feat_tracker_catchup_mode
Browse files Browse the repository at this point in the history
change the conditions switching the startup mode of the tracker
  • Loading branch information
kenshin-samourai authored Jul 6, 2019
2 parents b6073d4 + 38c9562 commit 7dd4af9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tracker/blockchain-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ class BlockchainProcessor extends AbstractProcessor {
* @returns {Promise}
*/
async catchup() {
// Get highest block in the blockchain
const info = await this.client.getblockchaininfo()

// Consider that we are in IBD mode if bitcoind is far in the past
this.isIBD = info.initialblockdownload && (info.blocks < 550000)
// Consider that we are in IBD mode if Dojo is far in the past
const highest = await db.getHighestBlock()
this.isIBD = highest.blockHeight < 570000

if (this.isIBD)
return this.catchupIBDMode()
Expand Down

0 comments on commit 7dd4af9

Please sign in to comment.