Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #569 from LiskHQ/0.8.1
Browse files Browse the repository at this point in the history
HOTFIX: Add exception for round 27040
  • Loading branch information
karmacoma authored May 2, 2017
2 parents 8dcc493 + 81c3ab0 commit d5e84a4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions helpers/RoundChanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var bignum = require('./bignum');
var slots = require('./slots');
var exceptions = require('./exceptions');

// Constructor
function RoundChanges (scope) {
Expand All @@ -12,6 +13,17 @@ function RoundChanges (scope) {
this.roundFees = Math.floor(scope.__private.feesByRound[scope.round]) || 0;
this.roundRewards = (scope.__private.rewardsByRound[scope.round] || []);
}

// Apply exception for round if required
if (exceptions.rounds[scope.round]) {
// Apply rewards factor
this.roundRewards.forEach(function (reward, index) {
this.roundRewards[index] = new bignum(reward.toPrecision(15)).times(exceptions.rounds[scope.round].rewards_factor).floor();
}.bind(this));

// Apply fees factor and bonus
this.roundFees = new bignum(this.roundFees.toPrecision(15)).times(exceptions.rounds[scope.round].fees_factor).plus(exceptions.rounds[scope.round].fees_bonus).floor();
}
}

// Public methods
Expand Down
3 changes: 3 additions & 0 deletions helpers/exceptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ module.exports = {
mainnet: 'd121d3abf5425fdc0f161d9ddb32f89b7750b4bdb0bff7d18b191d4b4bafa6d4',
testnet: 'c96dec3595ff6041c3bd28b76b8cf75dce8225173d1bd00241624ee89b50f2a8'
},
rounds: {
'27040': {rewards_factor: 2, fees_factor: 2, fees_bonus: 10000000}
},
senderPublicKey: [
'6140297682817553271', // 12526
'17693199811026162972', // 12532
Expand Down

0 comments on commit d5e84a4

Please sign in to comment.