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

Fixing #374 Renaming "Excluding" to "Expiring" for idtyWindow treatments

parent 8dba3be7
No related branches found
No related tags found
No related merge requests found
......@@ -412,7 +412,7 @@ function BlockchainContext() {
});
this.computeExpiredIdentities = (block) => co(function *() {
let lastForExpiry = yield dal.getIdentityExcludingBlock(block, conf.idtyWindow);
let lastForExpiry = yield dal.getIdentityExpiringBlock(block, conf.idtyWindow);
if (lastForExpiry) {
yield dal.flagExpiredIdentities(lastForExpiry.number, block.number);
}
......
......@@ -590,11 +590,11 @@ function FileDAL(params) {
}
});
this.getIdentityExcludingBlock = (current, idtyValidtyTime) => co(function *() {
this.getIdentityExpiringBlock = (current, idtyValidtyTime) => co(function *() {
let currentExcluding;
if (current.number > 0) {
try {
currentExcluding = yield that.indicatorsDAL.getCurrentIdentityExcludingBlock();
currentExcluding = yield that.indicatorsDAL.getCurrentIdentityExpiringBlock();
} catch (e) {
currentExcluding = null;
}
......@@ -603,7 +603,7 @@ function FileDAL(params) {
const root = yield that.getRootBlock();
const delaySinceStart = current.medianTime - root.medianTime;
if (delaySinceStart > idtyValidtyTime) {
return that.indicatorsDAL.writeCurrentExcludingForIdty(root).then(() => root);
return that.indicatorsDAL.writeCurrentExpiringForIdty(root).then(() => root);
}
} else {
// Check current position
......@@ -638,7 +638,7 @@ function FileDAL(params) {
//console.log('CRT: Search between %s and %s: %s => %s,%s', bottom, top, middle, isValidPeriod ? 'DOWN' : 'UP', isValidPeriodB ? 'DOWN' : 'UP');
if (isExcludin) {
// Found
yield that.indicatorsDAL.writeCurrentExcludingForIdty(middleBlock);
yield that.indicatorsDAL.writeCurrentExpiringForIdty(middleBlock);
newExcluding = middleBlock;
}
else if (isValidPeriod) {
......
......@@ -29,7 +29,7 @@ function IndicatorsDAL(rootPath, qioFS, parentCore, localDAL, AbstractStorage) {
this.writeCurrentExcludingForCert = (excluding) => that.coreFS.writeJSON('indicators/excludingCRT.json', excluding);
this.writeCurrentExcludingForIdty = (excluding) => that.coreFS.writeJSON('indicators/excludingIDTY.json', excluding);
this.writeCurrentExpiringForIdty = (excluding) => that.coreFS.writeJSON('indicators/expiringIDTY.json', excluding);
this.getCurrentMembershipExcludingBlock = () => that.coreFS.readJSON('indicators/excludingMS.json');
......@@ -37,5 +37,5 @@ function IndicatorsDAL(rootPath, qioFS, parentCore, localDAL, AbstractStorage) {
this.getCurrentCertificationExcludingBlock = () => that.coreFS.readJSON('indicators/excludingCRT.json');
this.getCurrentIdentityExcludingBlock = () => that.coreFS.readJSON('indicators/excludingIDTY.json');
this.getCurrentIdentityExpiringBlock = () => that.coreFS.readJSON('indicators/expiringIDTY.json');
}
......@@ -279,7 +279,7 @@ function IdentityDAL(db, wotb) {
* SANDBOX STUFF
*/
this.getSandboxIdentities = (underBlock) => that.query('SELECT ' +
this.getSandboxIdentities = () => that.query('SELECT ' +
'I.*, ' +
'I.hash, ' +
'(SELECT COUNT(*) FROM cert C where C.target = I.hash) AS certsCount, ' +
......@@ -287,7 +287,6 @@ function IdentityDAL(db, wotb) {
'FROM ' + that.table + ' as I ' +
'WHERE NOT I.member ' +
'AND I.expired IS NULL ' +
(underBlock !== undefined ? 'AND ref_block < ' + underBlock + ' ' : '') +
'ORDER BY certsCount DESC, ref_block ASC ' +
'LIMIT ' + (that.sandbox.maxSize), []);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment