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

[fix] #11: rule BR_G27 : do not count certs being replayed twice

parent 21f2304e
No related branches found
No related tags found
No related merge requests found
......@@ -2150,8 +2150,19 @@ For each ENTRY in local MINDEX where `op = 'UPDATE', expired_on = 0`:
For each ENTRY in local MINDEX where `type == 'JOIN' OR type == 'ACTIVE'`:
ENTRY.enoughCerts = COUNT(GLOBAL_CINDEX[receiver=ENTRY.pub,expired_on=null]) + COUNT(LOCAL_CINDEX[receiver=ENTRY.pub,expired_on=null]) >= sigQty
If `HEAD.version >= 12`
BLOCKCHAIN = REDUCE_BY(GLOBAL_CINDEX[receiver=ENTRY.pub], 'issuer')[expired_on=0]
INCOMING = LOCAL_CINDEX[receiver=ENTRY.pub]
UNIQUE_ISSUERS = UNIQ(CONCAT(
PICK(BLOCKCHAIN, 'issuer'),
PICK(INCOMING, 'issuer')))
ENTRY.enoughCerts = COUNT(UNIQUE_ISSUERS) >= sigQty
else
ENTRY.enoughCerts = COUNT(GLOBAL_CINDEX[receiver=ENTRY.pub,expired_on=0]) + COUNT(LOCAL_CINDEX[receiver=ENTRY.pub,expired_on=0]) >= sigQty
> Functionally: any member or newcomer needs `[sigQty]` certifications coming *to* him to be in the WoT
For each ENTRY in local MINDEX where `!(type == 'JOIN' OR type == 'ACTIVE')`:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment