mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #12462 from semaraugusto/develop
[docs] fix issue with delegating votes to wallets who cannot vote.
This commit is contained in:
commit
7a5be4a063
@ -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