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

Coinbase with just one output fails for the wrong reason #777

Closed
Ruteri opened this issue Mar 13, 2019 · 5 comments · Fixed by #1093
Closed

Coinbase with just one output fails for the wrong reason #777

Ruteri opened this issue Mar 13, 2019 · 5 comments · Fixed by #1093
Assignees
Labels
bug A problem of existing functionality
Milestone

Comments

@Ruteri
Copy link
Member

Ruteri commented Mar 13, 2019

In case a coinbase has just one output (the reward), which is stake + block reward + fees, it fails on "bad-cb-spends-too-little", and it should fail as the reward is incorrect - should only be block reward + fees. This is because the check assumes the reward amount is correct.

Checking that the outputs spend the correct amount should be done after checking the reward (the reward has to be correct).

@Ruteri Ruteri added the bug A problem of existing functionality label Mar 13, 2019
@Ruteri Ruteri added this to the 0.1 milestone Mar 13, 2019
@Nizametdinov
Copy link
Member

Maybe we should restrict the number of outputs in coinbase transactions. Then it can be checked earlier.

@scravy
Copy link
Member

scravy commented Apr 2, 2019

The number of outputs in coinbase transactions is not restricted as this enables forward compatibility and you can have any number of outputs due to stake splitting.

Are you talking about a lower bound?

@Nizametdinov
Copy link
Member

Yes, I meant to check that a coinbase transaction has at least two outputs.

@Nizametdinov
Copy link
Member

This issue should be postponed until #811 is merged since Consensus::CheckTxInputs has to be changed to take into account finalization rewards.

@thothd thothd modified the milestones: 0.1, 1.0 Apr 3, 2019
@scravy
Copy link
Member

scravy commented Apr 3, 2019

I would also like to have #808 settled before that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A problem of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants