Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
typescript
duniter
Commits
10412e2a
Commit
10412e2a
authored
8 years ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
[fix] Disable peers shuffling for Automated Tests 2
parent
56787cd1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/lib/sync.js
+2
-2
2 additions, 2 deletions
app/lib/sync.js
server.js
+3
-3
3 additions, 3 deletions
server.js
with
5 additions
and
5 deletions
app/lib/sync.js
+
2
−
2
View file @
10412e2a
...
@@ -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
,
s
hufflePeers
)
=>
co
(
function
*
()
{
this
.
sync
=
(
to
,
chunkLen
,
askedCautious
,
nopeers
,
noS
hufflePeers
)
=>
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
=
s
hufflePeers
?
_
.
shuffle
(
peers
)
:
peers
;
const
shuffledPeers
=
noS
hufflePeers
?
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
();
...
...
This diff is collapsed.
Click to expand it.
server.js
+
3
−
3
View file @
10412e2a
...
@@ -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
s
hufflePeers If true, sync will shuffle the retrieved peers before downloading on them.
* @param
noS
hufflePeers If true, sync will
NOT
shuffle the retrieved peers before downloading on them.
*/
*/
this
.
synchronize
=
(
onHost
,
onPort
,
upTo
,
chunkLength
,
interactive
,
askedCautious
,
nopeers
,
s
hufflePeers
)
=>
{
this
.
synchronize
=
(
onHost
,
onPort
,
upTo
,
chunkLength
,
interactive
,
askedCautious
,
nopeers
,
noS
hufflePeers
)
=>
{
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
,
s
hufflePeers
);
const
syncPromise
=
remote
.
sync
(
upTo
,
chunkLength
,
askedCautious
,
nopeers
,
noS
hufflePeers
===
true
);
return
{
return
{
flow
:
remote
,
flow
:
remote
,
syncPromise
:
syncPromise
syncPromise
:
syncPromise
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment