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

[fix] Sync failed on GTest

parent 941798c6
No related branches found
No related tags found
No related merge requests found
...@@ -155,18 +155,16 @@ export class QuickSynchronizer { ...@@ -155,18 +155,16 @@ export class QuickSynchronizer {
|| block.certifications.length || block.certifications.length
|| block.transactions.length || block.transactions.length
|| block.medianTime >= sync_nextExpiring) { || block.medianTime >= sync_nextExpiring) {
// logger.warn('>> Block#%s', block.number) const nextExpiringChanged = block.medianTime >= sync_nextExpiring
for (let i = 0; i < sync_expires.length; i++) { for (let i = 0; i < sync_expires.length; i++) {
let expire = sync_expires[i]; let expire = sync_expires[i];
if (block.medianTime > expire) { if (block.medianTime >= expire) {
sync_expires.splice(i, 1); sync_expires.splice(i, 1);
i--; i--;
} }
} }
const currentNextExpiring = sync_nextExpiring
sync_nextExpiring = sync_expires.reduce((max, value) => max ? Math.min(max, value) : value, 9007199254740991); // Far far away date sync_nextExpiring = sync_expires.reduce((max, value) => max ? Math.min(max, value) : value, 9007199254740991); // Far far away date
const nextExpiringChanged = currentNextExpiring !== sync_nextExpiring
// Fills in correctly the SINDEX // Fills in correctly the SINDEX
await Promise.all(_.where(sync_sindex.concat(local_sindex), { op: 'UPDATE' }).map(async (entry: any) => { await Promise.all(_.where(sync_sindex.concat(local_sindex), { op: 'UPDATE' }).map(async (entry: any) => {
......
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