Skip to content
Snippets Groups Projects
Commit 07afd425 authored by Éloïs's avatar Éloïs
Browse files

[fix] BR_G27: if block version < 12, sigQty=1

parent 771b5bdb
No related branches found
No related tags found
No related merge requests found
......@@ -867,7 +867,7 @@ export class Indexer {
mindex.map((ENTRY: MindexEntry) => {
ENTRY.isBeingRevoked = !!ENTRY.revoked_on;
});
yarn
// BR_G107
if (HEAD.number > 0) {
await Promise.all(
......@@ -978,23 +978,20 @@ export class Indexer {
);
// BR_G27
await Promise.all(
mindex.map(async (ENTRY: MindexEntry) => {
if (ENTRY.type == "JOIN" || ENTRY.type == "ACTIVE") {
const existing = (
await dal.cindexDAL.findByReceiverAndExpiredOn(ENTRY.pub, 0)
).map((value) => value.issuer);
const pending = Underscore.filter(
cindex,
(c: CindexEntry) => c.receiver == ENTRY.pub && c.expired_on == 0
).map((value) => value.issuer);
const uniqIssuers = Underscore.uniq(existing.concat(pending));
await Promise.all(mindex.map(async (ENTRY: MindexEntry) => {
if (ENTRY.type == 'JOIN' || ENTRY.type == 'ACTIVE') {
const existing = (await dal.cindexDAL.findByReceiverAndExpiredOn(ENTRY.pub, 0)).map(value => value.issuer)
const pending = Underscore.filter(cindex, (c:CindexEntry) => c.receiver == ENTRY.pub && c.expired_on == 0).map(value => value.issuer)
const uniqIssuers = Underscore.uniq(existing.concat(pending))
if (HEAD.version >= 12) {
ENTRY.enoughCerts = count(uniqIssuers) >= conf.sigQty;
} else {
ENTRY.enoughCerts = count(uniqIssuers) >= 1;
}
} else {
ENTRY.enoughCerts = true;
}
})
);
}))
// BR_G28
await Promise.all(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment