From 2297ec80477ab586e77df2b15656addf7946ca6d Mon Sep 17 00:00:00 2001 From: Ed Rotthoff Date: Fri, 11 Aug 2023 12:13:35 -0600 Subject: [PATCH 1/2] BD-2280 update total vote weight when user performs voteproxy after voting. BD-2280 update total vote wieght when user performs voteproxy after voting. --- contracts/fio.system/src/voting.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/fio.system/src/voting.cpp b/contracts/fio.system/src/voting.cpp index bb8530b4..94d82e0c 100755 --- a/contracts/fio.system/src/voting.cpp +++ b/contracts/fio.system/src/voting.cpp @@ -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 From 085b4117f3b68164e3029ed0991b66e6e2e80e94 Mon Sep 17 00:00:00 2001 From: Ed Rotthoff Date: Mon, 14 Aug 2023 19:39:24 -0600 Subject: [PATCH 2/2] new bug found, make account, proxy votes to second account , then reg account as proxy, then vote, verify total voted fio after all operations we need to clear the proxied vote weight whenever an account registers or re-registers as a proxy. --- contracts/fio.system/src/voting.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/fio.system/src/voting.cpp b/contracts/fio.system/src/voting.cpp index 94d82e0c..6747b745 100755 --- a/contracts/fio.system/src/voting.cpp +++ b/contracts/fio.system/src/voting.cpp @@ -1181,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;