mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add weight == 0 condition to giveRightToVote function
This will make it so votes can't be deleted accidentally by giving someone with weight > 1 the right to vote again
This commit is contained in:
parent
cb5f2f90f6
commit
552f2e5303
@ -94,7 +94,7 @@ of votes.
|
||||
// called incorrectly. But watch out, this
|
||||
// will currently also consume all provided gas
|
||||
// (this is planned to change in the future).
|
||||
require((msg.sender == chairperson) && !voters[voter].voted);
|
||||
require((msg.sender == chairperson) && !voters[voter].voted && (voters[voter].weight == 0));
|
||||
voters[voter].weight = 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user