Browse Source

Fixed vote weight results API call

blocksMintedPenalty is a negative value, so it should be added to blocksMinted, not subtracted.
master
QuickMythril 8 months ago committed by GitHub
parent
commit
f78764880c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      src/main/java/org/qortal/api/resource/PollsResource.java

2
src/main/java/org/qortal/api/resource/PollsResource.java

@ -142,7 +142,7 @@ public class PollsResource {
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;

Loading…
Cancel
Save