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
fdca7fd1
Commit
fdca7fd1
authored
9 years ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
Fix
#248
initial sync won't check for rules to be quicker
parent
04a3e2f6
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
+5
-3
5 additions, 3 deletions
app/lib/sync.js
bin/ucoind
+9
-1
9 additions, 1 deletion
bin/ucoind
with
14 additions
and
4 deletions
app/lib/sync.js
+
5
−
3
View file @
fdca7fd1
...
...
@@ -43,8 +43,7 @@ module.exports = function Synchroniser (server, host, port, conf, interactive) {
timeout
:
constants
.
NETWORK
.
SYNC_LONG_TIMEOUT
};
this
.
sync
=
(
to
,
nocautious
,
nopeers
)
=>
{
var
cautious
=
!
nocautious
,
logInterval
;
this
.
sync
=
(
to
,
askedCautious
,
nopeers
)
=>
{
logger
.
info
(
'
Connecting remote host...
'
);
return
co
(
function
*
()
{
var
node
=
yield
getVucoin
(
host
,
port
,
vucoinOptions
);
...
...
@@ -61,8 +60,11 @@ module.exports = function Synchroniser (server, host, port, conf, interactive) {
var
localNumber
=
lCurrent
?
lCurrent
.
number
:
-
1
;
var
remoteNumber
=
Math
.
min
(
rCurrent
.
number
,
to
||
rCurrent
.
number
);
// We use cautious mode if it is asked, or not particulary asked but blockchain has been started
var
cautious
=
(
askedCautious
===
true
||
(
askedCautious
===
undefined
&&
localNumber
>=
0
));
// Recurrent checking
logInterval
=
setInterval
(()
=>
{
setInterval
(()
=>
{
if
(
remoteNumber
>
1
&&
speed
>
0
)
{
var
remain
=
(
remoteNumber
-
(
localNumber
+
1
+
blocksApplied
));
var
secondsLeft
=
remain
/
speed
;
...
...
This diff is collapsed.
Click to expand it.
bin/ucoind
+
9
−
1
View file @
fdca7fd1
...
...
@@ -73,6 +73,7 @@ program
.
option
(
'
--nohttplogs
'
,
'
Disable HTTP logs
'
)
.
option
(
'
--nointeractive
'
,
'
Disable interactive sync UI
'
)
.
option
(
'
--nocautious
'
,
'
Do not check blocks validity during sync
'
)
.
option
(
'
--cautious
'
,
'
Check blocks validity during sync (overrides --nocautious option)
'
)
.
option
(
'
--nopeers
'
,
'
Do not retrieve peers during sync
'
)
.
option
(
'
--isolate
'
,
'
Avoid the node to send peering or status informations to the network
'
)
.
option
(
'
--check
'
,
'
With gen-next: just check validity of generated block
'
)
...
...
@@ -135,7 +136,14 @@ program
function
sync
(
server
,
host
,
port
,
conf
,
to
)
{
// Synchronize
var
remote
=
new
Synchroniser
(
server
,
host
,
port
,
conf
,
!
program
.
nointeractive
);
return
remote
.
sync
(
parseInt
(
to
),
program
.
nocautious
,
program
.
nopeers
);
let
cautious
;
if
(
program
.
nocautious
)
{
cautious
=
false
;
}
if
(
program
.
cautious
)
{
cautious
=
true
;
}
return
remote
.
sync
(
parseInt
(
to
),
cautious
,
program
.
nopeers
);
}
program
...
...
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