Skip to content
Snippets Groups Projects
Commit 1015eba8 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] #1246 Concurrent identities: keep only the most signed one

parent d7988cc2
No related branches found
No related tags found
3 merge requests!12331.6,!12291.6 into DockerBuild,!12251.6 fixes
...@@ -279,7 +279,9 @@ export class BlockGenerator { ...@@ -279,7 +279,9 @@ export class BlockGenerator {
const currentMembership = await this.dal.mindexDAL.getReducedMS(ms.issuer); const currentMembership = await this.dal.mindexDAL.getReducedMS(ms.issuer);
const currentMSN = currentMembership ? parseInt(currentMembership.created_on) : -1; const currentMSN = currentMembership ? parseInt(currentMembership.created_on) : -1;
if (!join.identity.revoked && currentMSN < parseInt(join.ms.number)) { if (!join.identity.revoked && currentMSN < parseInt(join.ms.number)) {
preJoinData[join.identity.pubkey] = join; if (!preJoinData[join.identity.pubkey] || preJoinData[join.identity.pubkey].certs.length < join.certs.length) {
preJoinData[join.identity.pubkey] = join;
}
} }
} catch (err) { } catch (err) {
if (err && !err.uerr) { if (err && !err.uerr) {
......
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