Skip to content

Commit 19f01cb

Browse files
authored
Merge pull request #341 from tronprotocol/develop-evan-votewitness
fix a bug: The vote count is based on TRX not drop
2 parents e039f82 + 66108ee commit 19f01cb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/org/tron/core/actuator/VoteWitnessActuator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public boolean validate() throws ContractValidateException {
7878
long share = dbManager.getAccountStore().get(contract.getOwnerAddress().toByteArray())
7979
.getShare();
8080
long sum = contract.getVotesList().stream().mapToLong(vote -> vote.getVoteCount()).sum();
81+
sum *= 1000000; //trx -> drop. The vote count is based on TRX
8182
if (sum > share) {
8283
throw new ContractValidateException(
8384
"The total number of votes[" + sum + "] is greater than the share[" + share + "]");

0 commit comments

Comments
 (0)