Skip to content

Commit

Permalink
Merge pull request #315 from fioprotocol/feature/BD-2280-fiocontracts…
Browse files Browse the repository at this point in the history
…-develop-08112023

BD-2280 update total vote weight when user performs voteproxy after voting
  • Loading branch information
edrotthoff authored Aug 16, 2023
2 parents 174cf43 + 085b411 commit 0f15ccc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contracts/fio.system/src/voting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,10 @@ namespace eosiosystem {
p.id = id;
p.owner = actor;
});
}else{
if((voter_proxy_iter->last_vote_weight > 0)&&!(voter_proxy_iter->proxy)) {
_gstate.total_voted_fio -= voter_proxy_iter->last_vote_weight;
}
}

//note -- we can call these lock token computations like this
Expand Down Expand Up @@ -1177,6 +1181,7 @@ namespace eosiosystem {
votersbyowner.modify(pitr, same_payer, [&](auto &p) {
p.fioaddress = fio_address;
p.addresshash = addresshash;
p.proxied_vote_weight = 0;
p.is_proxy = isproxy;
p.is_auto_proxy = false;
p.proxy = nm;
Expand Down

0 comments on commit 0f15ccc

Please sign in to comment.