Browse Source
Merge pull request #32 from Samourai-Wallet/feat_tracker_catchup_mode
change the conditions switching the startup mode of the tracker
umbrel
kenshin samourai
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
5 deletions
-
tracker/blockchain-processor.js
|
|
@ -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() |
|
|
|