From 15b82ed5c5ba36f47e02ad2051878b9217a19373 Mon Sep 17 00:00:00 2001
From: cgeek <cem.moreau@gmail.com>
Date: Sun, 20 Dec 2015 18:50:29 +0100
Subject: [PATCH] Hotfix: blockchain was stuck due to the integration of
 invalid certifications

---
 app/service/BlockchainService.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/service/BlockchainService.js b/app/service/BlockchainService.js
index c7e735161..7bcd2fbb6 100644
--- a/app/service/BlockchainService.js
+++ b/app/service/BlockchainService.js
@@ -831,7 +831,7 @@ function BlockchainService (conf, mainDAL, pair) {
                 throw 'Too old certification';
               }
               // Already exists a link not replayable yet?
-              var exists = yield dal.existsLinkFromOrAfterDate(cert.from, cert.to, current.medianTime - conf.sigDelay);
+              var exists = yield dal.existsLinkFromOrAfterDate(cert.from, cert.to, current.medianTime - conf.sigDelay - conf.sigValidity);
               if (exists) {
                 throw 'It already exists a similar certification written, which is not replayable yet';
               }
@@ -1445,7 +1445,7 @@ function NextBlockGenerator(conf, dal) {
         var exists = false;
         if (current) {
           // Already exists a link not replayable yet?
-          exists = yield dal.existsLinkFromOrAfterDate(cert.from, cert.to, current.medianTime - conf.sigDelay);
+          exists = yield dal.existsLinkFromOrAfterDate(cert.from, cert.to, current.medianTime - conf.sigDelay - conf.sigValidity);
         }
         if (!exists) {
           // It does NOT already exists a similar certification written, which is not replayable yet
-- 
GitLab