mirror of
https://github.com/Qortal/qortal.git
synced 2025-03-26 23:44:34 +00:00
Merge pull request #176 from QuickMythril/votes-api-fix
Fixed vote weight results API call
This commit is contained in:
commit
dcedcf8685
@ -142,7 +142,7 @@ public class PollsResource {
|
|||||||
for (VoteOnPollData vote : votes) {
|
for (VoteOnPollData vote : votes) {
|
||||||
String voter = Crypto.toAddress(vote.getVoterPublicKey());
|
String voter = Crypto.toAddress(vote.getVoterPublicKey());
|
||||||
AccountData voterData = repository.getAccountRepository().getAccount(voter);
|
AccountData voterData = repository.getAccountRepository().getAccount(voter);
|
||||||
int voteWeight = voterData.getBlocksMinted() - voterData.getBlocksMintedPenalty();
|
int voteWeight = voterData.getBlocksMinted() + voterData.getBlocksMintedPenalty();
|
||||||
if (voteWeight < 0) voteWeight = 0;
|
if (voteWeight < 0) voteWeight = 0;
|
||||||
totalWeight += voteWeight;
|
totalWeight += voteWeight;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user