Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Fix confirmations check #4566

Merged
merged 1 commit into from
Aug 10, 2018
Merged

Fix confirmations check #4566

merged 1 commit into from
Aug 10, 2018

Conversation

spartucus
Copy link
Contributor

No description provided.

Copy link
Contributor

@heifner heifner left a comment

Choose a reason for hiding this comment

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

Why do you believe this change is needed?

@spartucus
Copy link
Contributor Author

> *2 / 3 makes little difference to >= *2/3 + 1, it keeps consistence with others.
For example: https://github.com/EOSIO/eos/blob/master/libraries/chain/block_header_state.cpp#L72-L76

static_assert(std::numeric_limits<uint8_t>::max() >= (config::max_producers * 2 / 3) + 1, "8bit confirmations may not be able to hold all of the needed confirmations");

// This uses the previous block active_schedule because thats the "schedule" that signs and therefore confirms _this_ block
auto num_active_producers = active_schedule.producers.size();
uint32_t required_confs = (uint32_t)(num_active_producers * 2 / 3) + 1;

If you think there's no need or i understand this wrong, no hard feelings to close the PR. :)

@heifner heifner changed the base branch from master to develop August 10, 2018 13:02
@heifner heifner merged commit e58b62c into EOSIO:develop Aug 10, 2018
@spartucus spartucus deleted the patch-1 branch August 11, 2018 01:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants