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

blockchain_db: add clarification to get_block_already_generated_coins #8913

Merged

Conversation

jeffro256
Copy link
Contributor

No description provided.

@@ -1053,7 +1053,7 @@ class BlockchainDB
* @brief fetch a block's already generated coins
*
* The subclass should return the total coins generated as of the block
* with the given height.
* with the given height, capped to a maximum value of MONEY_SUPPLY.
Copy link
Collaborator

Choose a reason for hiding this comment

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

if that's so, what's the point of this function now, since we're in tail emission, well beyond the original money supply?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point... I looked into it, and it happens that get_block_already_generated_coins() is only ever fetched for the very top block. And since we are past tail emission, we don't need those values anyways and can hardcode a value of coins which gives us the same result for block reward calculations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(maybe) I'll do some testing for that, since I wanted to do a migration anyways to add a field to mdb_block_info anyways, this could make it 0-cost ;)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Removing it should preclude syncs without fast block sync.

@luigi1111 luigi1111 merged commit fc84506 into monero-project:master Aug 17, 2023
@jeffro256 jeffro256 deleted the already_generated_coins_comment branch October 15, 2023 06:39
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.

5 participants