forked from Qortal/qortal
Fixed vote weight results API call
blocksMintedPenalty is a negative value, so it should be added to blocksMinted, not subtracted.
This commit is contained in:
parent
070f14b3dd
commit
f78764880c
@ -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…
Reference in New Issue
Block a user