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

[fix] Disable peers shuffling for Automated Tests 2

parent 56787cd1
No related branches found
No related tags found
No related merge requests found
...@@ -89,7 +89,7 @@ function Synchroniser (server, host, port, conf, interactive) { ...@@ -89,7 +89,7 @@ function Synchroniser (server, host, port, conf, interactive) {
return node.getCurrent(); return node.getCurrent();
}); });
this.sync = (to, chunkLen, askedCautious, nopeers, shufflePeers) => co(function*() { this.sync = (to, chunkLen, askedCautious, nopeers, noShufflePeers) => co(function*() {
try { try {
...@@ -166,7 +166,7 @@ function Synchroniser (server, host, port, conf, interactive) { ...@@ -166,7 +166,7 @@ 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 || localNumber >= 0); const cautious = (askedCautious === true || localNumber >= 0);
const shuffledPeers = shufflePeers ? _.shuffle(peers) : peers; const shuffledPeers = noShufflePeers ? peers : _.shuffle(peers);
const downloader = new P2PDownloader(localNumber, to, rCurrent.hash, shuffledPeers, watcher); const downloader = new P2PDownloader(localNumber, to, rCurrent.hash, shuffledPeers, watcher);
downloader.start(); downloader.start();
......
...@@ -441,11 +441,11 @@ function Server (dbConf, overrideConf) { ...@@ -441,11 +441,11 @@ function Server (dbConf, overrideConf) {
* @param interactive Tell if the loading bars should be used for console output. * @param interactive Tell if the loading bars should be used for console output.
* @param askedCautious If true, force the verification of each downloaded block. This is the right way to have a valid blockchain for sure. * @param askedCautious If true, force the verification of each downloaded block. This is the right way to have a valid blockchain for sure.
* @param nopeers If true, sync will omit to retrieve peer documents. * @param nopeers If true, sync will omit to retrieve peer documents.
* @param shufflePeers If true, sync will shuffle the retrieved peers before downloading on them. * @param noShufflePeers If true, sync will NOT shuffle the retrieved peers before downloading on them.
*/ */
this.synchronize = (onHost, onPort, upTo, chunkLength, interactive, askedCautious, nopeers, shufflePeers) => { this.synchronize = (onHost, onPort, upTo, chunkLength, interactive, askedCautious, nopeers, noShufflePeers) => {
const remote = new Synchroniser(that, onHost, onPort, that.conf, interactive === true); const remote = new Synchroniser(that, onHost, onPort, that.conf, interactive === true);
const syncPromise = remote.sync(upTo, chunkLength, askedCautious, nopeers, shufflePeers); const syncPromise = remote.sync(upTo, chunkLength, askedCautious, nopeers, noShufflePeers === true);
return { return {
flow: remote, flow: remote,
syncPromise: syncPromise syncPromise: syncPromise
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment