-
Notifications
You must be signed in to change notification settings - Fork 47
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
Fix extractCommitteeMember #1511
Comments
We discussed this in Amsterdam. Can you confirm that? |
The first check shall not be necessary. So, back to your question
About the last point, maybe it worth to add a check into the stake contract in order to not perform unstake for the last provisioner |
@herr-seppia
Is this necessary? |
I think we misinterpreted the code. So the first check is actually necessary for the loop to work. The second check ( |
Yes, you're right. In that case, I suggest to change the comments with - // extractCommitteeMember walks through the provisioners set, while deducting each stake
+ // extractCommitteeMember loops the provisioners set, while deducting each stake and - // If a provisioner is missing, we use the provisioner at position 0
+ // If a provisioner is missing it means that we've reached the end of the set.
+ // Then we use the provisioner at position 0 and continue to loop |
…ember Fix extractCommitteeMember loop Resolves #1511
QUESTIONS on
extractCommitteeMember
Originally posted by @fed-franz in #1491 (comment)
Original code:
This line:
if m, e = p.MemberAt(i); e != nil {
handles the case in which a Member is missing.
Q: When does/can this occur?
This line:
m, e = p.MemberAt(0)
handles a missing Member by setting the current member 'm' to Member 0.
Q: What's the logic behind this?
This line:
if err != nil {
seems similar to the case in which a member is missing.
Q: When does this occur? What's the difference between the two cases?
The text was updated successfully, but these errors were encountered: