Skip to content

Commit

Permalink
Merge pull request #176 from QuickMythril/votes-api-fix
Browse files Browse the repository at this point in the history
Fixed vote weight results API call
  • Loading branch information
crowetic authored Feb 1, 2024
2 parents 070f14b + f787648 commit dcedcf8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/qortal/api/resource/PollsResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public PollVotes getPollVotes(@PathParam("pollName") String pollName, @QueryPara
for (VoteOnPollData vote : votes) {
String voter = Crypto.toAddress(vote.getVoterPublicKey());
AccountData voterData = repository.getAccountRepository().getAccount(voter);
int voteWeight = voterData.getBlocksMinted() - voterData.getBlocksMintedPenalty();
int voteWeight = voterData.getBlocksMinted() + voterData.getBlocksMintedPenalty();
if (voteWeight < 0) voteWeight = 0;
totalWeight += voteWeight;

Expand Down

0 comments on commit dcedcf8

Please sign in to comment.