From cde60fc84c5193ad9b91235673c9bd8222edde75 Mon Sep 17 00:00:00 2001
From: librelois <elois@ifee.fr>
Date: Thu, 15 Feb 2018 19:48:21 +0100
Subject: [PATCH] fix #1277

---
 app/modules/prover/lib/blockGenerator.ts | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/app/modules/prover/lib/blockGenerator.ts b/app/modules/prover/lib/blockGenerator.ts
index 39d9cb45a..abe65011b 100644
--- a/app/modules/prover/lib/blockGenerator.ts
+++ b/app/modules/prover/lib/blockGenerator.ts
@@ -114,13 +114,15 @@ export class BlockGenerator {
       obj.currency = this.conf.currency
       const tx = TransactionDTO.fromJSONObject(obj);
       try {
-        await LOCAL_RULES_HELPERS.checkBunchOfTransactions(passingTxs.concat(tx), this.conf, options)
+        const tx_check_1 = await LOCAL_RULES_HELPERS.checkBunchOfTransactions(passingTxs.concat(tx), this.conf, options)
         const nextBlockWithFakeTimeVariation = { medianTime: current.medianTime + 1 };
-        await GLOBAL_RULES_HELPERS.checkSingleTransaction(tx, nextBlockWithFakeTimeVariation, this.conf, this.dal, ALSO_CHECK_PENDING_TXS);
-        await GLOBAL_RULES_HELPERS.checkTxBlockStamp(tx, this.dal);
-        transactions.push(tx);
-        passingTxs.push(tx);
-        this.logger.info('Transaction %s added to block', tx.hash);
+        const tx_check_2 = await GLOBAL_RULES_HELPERS.checkSingleTransaction(tx, nextBlockWithFakeTimeVariation, this.conf, this.dal, ALSO_CHECK_PENDING_TXS);
+        const tx_check_3 = await GLOBAL_RULES_HELPERS.checkTxBlockStamp(tx, this.dal);
+        if (tx_check_1 && tx_check_2 && tx_check_3) {
+          transactions.push(tx);
+          passingTxs.push(tx);
+          this.logger.info('Transaction %s added to block', tx.hash);
+        }
       } catch (err) {
         this.logger.error(err);
         const currentNumber = (current && current.number) || 0;
-- 
GitLab