Commit 3911f6c0 authored by Cédric Moreau's avatar Cédric Moreau

[enh] Switch to block v11: based on **last** issuer's nonce (cherry-picked from 1.7 branch)

parent 8fa58ed7
......@@ -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) => b1.number - b2.number)
.sort((b1:any, b2:any) => b2.number - b1.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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment