diff --git a/app/lib/indexer.ts b/app/lib/indexer.ts index c691672f4c65e06431fbe83894f2d28104eb0f9e..df184e6b782eaebc1dbab0a00f48bb21f41e9191 100644 --- a/app/lib/indexer.ts +++ b/app/lib/indexer.ts @@ -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 = true; + ENTRY.enoughCerts = count(uniqIssuers) >= 1; } - }) - ); + } else { + ENTRY.enoughCerts = true; + } + })) // BR_G28 await Promise.all(