Skip to content
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

Including tx fee into block rewards #752

Closed
wants to merge 3 commits into from

Conversation

ShengguangXiao
Copy link
Contributor

@ShengguangXiao ShengguangXiao commented Sep 22, 2021

What kind of PR is this?:

/kind fix

What this PR does / why we need it:

Tx fees not included in the block rewards

Which issue(s) does this PR fixes?:

Fixes #

https://github.com/cakedefi/defichain-private/issues/681

Additional comments?:

@ShengguangXiao ShengguangXiao force-pushed the fix/include-txfee-to-miner-rewards branch from 672d779 to e377b81 Compare September 22, 2021 03:28
@@ -239,7 +239,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
coinbaseTx.vout.resize(2);

// Explicitly set miner reward
coinbaseTx.vout[0].nValue = CalculateCoinbaseReward(blockReward, consensus.dist.masternode);
coinbaseTx.vout[0].nValue = nFees + CalculateCoinbaseReward(blockReward, consensus.dist.masternode);
Copy link
Contributor

@bvbfan bvbfan Sep 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be covered by hardfork height

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The validation should still pass even without fork height.

if (cbValues.at(DCT_ID{0}) > blockReward + nFees)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go without hardfork, newer nodes will generate bigger reward than older one, It's inconstancy.

Copy link
Contributor Author

@ShengguangXiao ShengguangXiao Sep 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make the change in another PR based on 1.9.x.
#764

@ShengguangXiao
Copy link
Contributor Author

Close this in favor of #764

@bvbfan bvbfan closed this Sep 30, 2021
@bvbfan bvbfan deleted the fix/include-txfee-to-miner-rewards branch September 30, 2021 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants