Skip to content

Commit

Permalink
Fix block template reward/fees type errors.
Browse files Browse the repository at this point in the history
See z-classic/z-nomp#15 for details.
  • Loading branch information
Bob Feldbauer committed Dec 2, 2016
1 parent 9485fe9 commit 8c3b240
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/blockTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ var BlockTemplate = module.exports = function BlockTemplate(jobId, rpcData, extr
this.difficulty = parseFloat((diff1 / this.target.toNumber()).toFixed(9));

// generate the fees and coinbase tx
var blockReward = (this.rpcData.miner + this.rpcData.founders) * 100000000; // TODO: Add Zcash support
var blockReward = bignum(this.rpcData.miner).add(this.rpcData.founders).mul(100000000).toNumber(); // TODO: Add Zcash support
var fees = [];
rpcData.transactions.forEach(function(value) {
fees.push(value);
});
this.reward = transactions.getFees(fees) + blockReward;
this.reward = bignum(transactions.getFees(fees)).add(blockReward).toNumber();
rpcData.reward = this.reward;

if (typeof this.genTx === 'undefined') {
Expand Down

0 comments on commit 8c3b240

Please sign in to comment.