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

Add block and voters count in election information #2414

Conversation

guilhermelawless
Copy link
Contributor

Considered adding more details such as the number of votes for each block, but would need to tally up each election.

Similar to a previous PR, uses assert (!node.active.mutex.try_lock ()); which can have undefined behavior, but only used in Debug. Don't see an easy alternative in this case, and it was already used in election.cpp.

@guilhermelawless guilhermelawless added documentation This item indicates the need for or supplies updated or expanded documentation rpc nonbreaking change websockets labels Nov 25, 2019
@guilhermelawless guilhermelawless added this to the V21.0 milestone Nov 25, 2019
@guilhermelawless guilhermelawless self-assigned this Nov 25, 2019
@cryptocode
Copy link
Contributor

cryptocode commented Nov 25, 2019

Most likely for a separate PR: I think you raise a good point about try_lock, even if it's in an assert. I know it's already done a couple of places, but election referencing node.active.mutex seems wrong to me. Not sure if we should add more of those. There are many data types that need external synchronization, and they generally don't reach out to an external mutex to see if it's locked. Maybe the cleanest solution is to put a mutex on election and make sure its properly encapsulated.

@guilhermelawless
Copy link
Contributor Author

Agree 100%, see issue 2415 for tracking this. One glaring location is vote_processor::vote_blocking

wezrule
wezrule previously approved these changes Dec 5, 2019
cryptocode
cryptocode previously approved these changes Dec 5, 2019
@guilhermelawless guilhermelawless merged commit b58ee7f into nanocurrency:develop Dec 5, 2019
@guilhermelawless guilhermelawless deleted the election-status-blocks-and-voters branch December 5, 2019 19:08
@zhyatt zhyatt added rpc Changes related to Remote Procedure Calls enhancement and removed rpc nonbreaking change labels Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This item indicates the need for or supplies updated or expanded documentation enhancement rpc Changes related to Remote Procedure Calls websockets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants