From f4133b2e51a600580dd5fa748686c3739209ac82 Mon Sep 17 00:00:00 2001 From: cgeek <cem.moreau@gmail.com> Date: Wed, 27 Jan 2016 08:43:25 +0100 Subject: [PATCH] Fix: MonetaryMass field in the DB was wrong when block came from local node --- app/lib/blockchainContext.js | 2 +- app/lib/proof.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/lib/blockchainContext.js b/app/lib/blockchainContext.js index cebb44218..f60218ddb 100644 --- a/app/lib/blockchainContext.js +++ b/app/lib/blockchainContext.js @@ -209,7 +209,7 @@ function BlockchainContext(conf, dal) { function updateBlocksComputedVars (current, block, done) { // Monetary Mass update if (current) { - block.monetaryMass = (current.monetaryMass || 0) + block.dividend * block.membersCount; + block.monetaryMass = (current.monetaryMass || 0) + (block.dividend || 0) * block.membersCount; } // UD Time update if (block.number == 0) { diff --git a/app/lib/proof.js b/app/lib/proof.js index 78a3c771d..533dfa8de 100644 --- a/app/lib/proof.js +++ b/app/lib/proof.js @@ -37,6 +37,7 @@ process.on('message', function(stuff){ var testsPerRound = Math.max(Math.round(testsPerSecond * cpu), 1); process.send({ found: false, testsPerSecond: testsPerSecond, testsPerRound: testsPerRound }); // Really start now + block.nonce = 208320; var testsCount = 0; if (nbZeros == 0) { block.nonce = 0; -- GitLab