Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
timothe
duniter
Commits
3911f6c0
Commit
3911f6c0
authored
Dec 30, 2018
by
Cédric Moreau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[enh] Switch to block v11: based on **last** issuer's nonce (cherry-picked from 1.7 branch)
parent
8fa58ed7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
app/lib/rules/local_rules.ts
app/lib/rules/local_rules.ts
+1
-1
No files found.
app/lib/rules/local_rules.ts
View file @
3911f6c0
...
...
@@ -536,7 +536,7 @@ export const LOCAL_RULES_HELPERS = {
// 2. If we can, we go to the next version
const
blocksInFrame
=
(
await
dal
.
getBlocksBetween
(
current
.
number
-
current
.
issuersFrame
+
1
,
current
.
number
))
.
sort
((
b1
:
any
,
b2
:
any
)
=>
b
1
.
number
-
b
2
.
number
)
.
sort
((
b1
:
any
,
b2
:
any
)
=>
b
2
.
number
-
b
1
.
number
)
const
uniqIssuersInFrame
=
_
.
uniq
(
blocksInFrame
.
map
((
b
:
any
)
=>
b
.
issuer
))
const
lastNonceOfEachIssuer
=
uniqIssuersInFrame
.
map
((
issuer
:
any
)
=>
String
(
blocksInFrame
.
filter
((
b
:
any
)
=>
b
.
issuer
===
issuer
)[
0
].
nonce
))
const
nbNoncesWithNextVersionCode
=
lastNonceOfEachIssuer
.
filter
((
nonce
:
string
)
=>
nonce
.
substr
(
-
11
,
3
)
===
'
999
'
).
length
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment