Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lib/Rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,19 @@ Rpc.getBlock = function(hash, cb) {
}

// Number of voters for the block in question
var voters = info.result.voters;
var votersProportion = info.result.voters == 0 ? 1 : info.result.voters / 5;

// Calculate the 3 different portions of block reward
var work = Math.round(base * workProportion / 10 * voters / 5);
var stake = Math.round(base * stakeProportion / 10 * voters / 5);
var tax = Math.round(base * taxProportion / 10 * voters / 5);

var work = base * workProportion / 10 * votersProportion;
var stake = base * stakeProportion / 10 * votersProportion;
var tax = base * taxProportion / 10 * votersProportion;

// If block height is below mainnet voting height, leave out stake
if (info.result.height < 4096) {
info.result.reward = (work + tax) / bitcore.util.COIN;
info.result.reward = Math.round(work + tax) / bitcore.util.COIN;
} else {
info.result.reward = (work + stake + tax) / bitcore.util.COIN;
info.result.reward = Math.round(work + stake + tax) / bitcore.util.COIN;
}
}
return cb(err,info.result);
Expand Down