From fe5e4bf3d692008d2c51066aa9866ca3f376d728 Mon Sep 17 00:00:00 2001 From: cgeek <cem.moreau@gmail.com> Date: Mon, 17 Dec 2018 18:16:56 +0100 Subject: [PATCH] [enh] Switch to block v11: based on **last** issuer's nonce --- app/lib/rules/local_rules.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/rules/local_rules.ts b/app/lib/rules/local_rules.ts index 9080bbe0e..d6c56b1c3 100644 --- a/app/lib/rules/local_rules.ts +++ b/app/lib/rules/local_rules.ts @@ -533,7 +533,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, b2) => b1.number - b2.number) + .sort((b1, b2) => b2.number - b1.number) const uniqIssuersInFrame = Underscore.uniq(blocksInFrame.map(b => b.issuer)) const lastNonceOfEachIssuer = uniqIssuersInFrame.map(issuer => String(blocksInFrame.filter(b => b.issuer === issuer)[0].nonce)) const nbNoncesWithNextVersionCode = lastNonceOfEachIssuer.filter(nonce => nonce.substr(-11, 3) === '999').length -- GitLab