New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block reward exceptions - Closes #607 #608
Conversation
modules/blocks/verify.js
Outdated
@@ -122,7 +124,7 @@ Verify.prototype.verifyBlock = function (block) { | |||
// Calculate expected rewards | |||
var expectedReward = __private.blockReward.calcReward(block.height); | |||
|
|||
if (block.height !== 1 && expectedReward !== block.reward) { | |||
if (block.height !== 1 && expectedReward !== block.reward && !_.includes(exceptions.blockRewards, block.id)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of including lodash just for that - we can perform that check like && exceptions.blockRewards.indexOf(block.id) === -1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good vanillaJS catch
helpers/exceptions.js
Outdated
@@ -18,6 +18,10 @@ module.exports = { | |||
rounds: { | |||
'27040': {rewards_factor: 2, fees_factor: 2, fees_bonus: 10000000} | |||
}, | |||
blockRewards: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That list need to be empty for mainnet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup these exceptions are only present in testnet branches.
We could declare the array empty though, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, sure.
Added missed code
0.4.0b
Adding testnet specific blockReward exceptions.Closes #607