mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
fix issue with delegating votes to people who cannot vote. That made it so that if wallet A delegated to wallet B and B had no rights to vote, than B would lose out on its own vote
This commit is contained in:
parent
b28cd00aa0
commit
942a3301dc
@ -130,9 +130,12 @@ of votes.
|
|||||||
|
|
||||||
// Since `sender` is a reference, this
|
// Since `sender` is a reference, this
|
||||||
// modifies `voters[msg.sender].voted`
|
// modifies `voters[msg.sender].voted`
|
||||||
|
Voter storage delegate_ = voters[to];
|
||||||
|
|
||||||
|
// Voters cannot delegate to wallets that cannot vote.
|
||||||
|
require(delegate_.weight >= 1)
|
||||||
sender.voted = true;
|
sender.voted = true;
|
||||||
sender.delegate = to;
|
sender.delegate = to;
|
||||||
Voter storage delegate_ = voters[to];
|
|
||||||
if (delegate_.voted) {
|
if (delegate_.voted) {
|
||||||
// If the delegate already voted,
|
// If the delegate already voted,
|
||||||
// directly add to the number of votes
|
// directly add to the number of votes
|
||||||
|
Loading…
Reference in New Issue
Block a user