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

Revert: Fix: this polluting global

parent 75763a4f
No related branches found
No related tags found
No related merge requests found
...@@ -105,15 +105,15 @@ function Synchroniser (server, host, port, conf, interactive) { ...@@ -105,15 +105,15 @@ function Synchroniser (server, host, port, conf, interactive) {
// We use cautious mode if it is asked, or not particulary asked but blockchain has been started // We use cautious mode if it is asked, or not particulary asked but blockchain has been started
const cautious = (askedCautious === true || (askedCautious === undefined && localNumber >= 0)); const cautious = (askedCautious === true || (askedCautious === undefined && localNumber >= 0));
let lastBlock = null;
let dao = pulling.abstractDao({ let dao = pulling.abstractDao({
lastBlock: null,
// Get the local blockchain current block // Get the local blockchain current block
localCurrent: () => co(function*() { localCurrent: () => co(function*() {
if (cautious) { if (cautious) {
return yield dal.getCurrentBlockOrNull(); return yield dal.getCurrentBlockOrNull();
} else { } else {
return lastBlock; return this.lastBlock;
} }
}), }),
...@@ -156,7 +156,7 @@ function Synchroniser (server, host, port, conf, interactive) { ...@@ -156,7 +156,7 @@ function Synchroniser (server, host, port, conf, interactive) {
} else { } else {
yield server.BlockchainService.saveBlocksInMainBranch(blocks); yield server.BlockchainService.saveBlocksInMainBranch(blocks);
} }
lastBlock = blocks[blocks.length - 1]; this.lastBlock = blocks[blocks.length - 1];
watcher.appliedPercent(Math.floor(blocks[blocks.length - 1].number / to * 100)); watcher.appliedPercent(Math.floor(blocks[blocks.length - 1].number / to * 100));
return true; return true;
}), }),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment