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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/blockchain_db/blockchain_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

*
* If the block does not exist, the subclass should throw BLOCK_DNE
*
Expand Down