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

[fix] #858 Have a symmetric DB between with or without `--cautious` option during sync

parent 83bdc07f
No related branches found
No related tags found
No related merge requests found
......@@ -1366,22 +1366,13 @@ const indexer = module.exports = {
const MS = yield dal.mindexDAL.getReducedMS(POTENTIAL.pub);
const hasRenewedSince = MS.expires_on > HEAD.medianTime;
if (!MS.expired_on && !hasRenewedSince) {
let shouldBeKicked = true;
// ------ Fast synchronization specific code ------
const idty = yield dal.iindexDAL.getFromPubkey(POTENTIAL.pub);
if (!idty.member) {
shouldBeKicked = false;
}
// ------------------------------------------------
if (shouldBeKicked) {
expiries.push({
op: 'UPDATE',
pub: MS.pub,
created_on: MS.created_on,
written_on: [HEAD.number, HEAD.hash].join('-'),
expired_on: HEAD.medianTime
});
}
expiries.push({
op: 'UPDATE',
pub: MS.pub,
created_on: MS.created_on,
written_on: [HEAD.number, HEAD.hash].join('-'),
expired_on: HEAD.medianTime
});
}
}
return expiries;
......
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