Skip to content
Snippets Groups Projects
Commit 0e9cd32c authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[enh] Take into account `--cautious` mode for sync when given

parent c9384483
No related branches found
No related tags found
No related merge requests found
...@@ -84,6 +84,7 @@ export class GlobalIndexStream extends Duplex { ...@@ -84,6 +84,7 @@ export class GlobalIndexStream extends Duplex {
private dal:FileDAL, private dal:FileDAL,
private to: number, private to: number,
private localNumber:number, private localNumber:number,
private cautious: boolean,
private syncStrategy: AbstractSynchronizer, private syncStrategy: AbstractSynchronizer,
private watcher:Watcher, private watcher:Watcher,
) { ) {
...@@ -172,7 +173,7 @@ export class GlobalIndexStream extends Duplex { ...@@ -172,7 +173,7 @@ export class GlobalIndexStream extends Duplex {
await DuniterBlockchain.saveParametersForRoot(block, this.conf, this.dal) await DuniterBlockchain.saveParametersForRoot(block, this.conf, this.dal)
} }
if (block.number <= this.to - this.conf.forksize || cliprogram.noSources) { // If we require nosources option, this blockchain can't be valid so we don't make checks if ((block.number <= this.to - this.conf.forksize || cliprogram.noSources) && !this.cautious) { // If we require nosources option, this blockchain can't be valid so we don't make checks
const HEAD = await Indexer.quickCompleteGlobalScope(block, this.sync_currConf, sync_bindex, data.iindex, data.mindex, data.cindex, this.dal) const HEAD = await Indexer.quickCompleteGlobalScope(block, this.sync_currConf, sync_bindex, data.iindex, data.mindex, data.cindex, this.dal)
sync_bindex.push(HEAD) sync_bindex.push(HEAD)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment