File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
src/main/java/org/tron/core/witness Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -315,7 +315,7 @@ public void updateWitness() {
315315 .get (StringUtil .createDbKey (address ));
316316 if (null == witnessCapsule ) {
317317 logger .warn ("witnessCapsule is null.address is {}" ,
318- StringUtil .createReadableString (address ));
318+ StringUtil .createReadableString (address ));
319319 return ;
320320 }
321321
@@ -376,12 +376,13 @@ private void payStandbyWitness(List<ByteString> list) {
376376 for (ByteString b : list ) {
377377 voteSum += getWitnesseByAddress (b ).getVoteCount ();
378378 }
379- for (ByteString b : list ) {
380- long pay = getWitnesseByAddress (b ).getVoteCount () * totalPay / voteSum ;
381- AccountCapsule accountCapsule = manager .getAccountStore ().get (b .toByteArray ());
382- accountCapsule .setAllowance (accountCapsule .getAllowance () + pay );
383- manager .getAccountStore ().put (accountCapsule .createDbKey (), accountCapsule );
379+ if (voteSum > 0 ) {
380+ for (ByteString b : list ) {
381+ long pay = getWitnesseByAddress (b ).getVoteCount () * totalPay / voteSum ;
382+ AccountCapsule accountCapsule = manager .getAccountStore ().get (b .toByteArray ());
383+ accountCapsule .setAllowance (accountCapsule .getAllowance () + pay );
384+ manager .getAccountStore ().put (accountCapsule .createDbKey (), accountCapsule );
385+ }
384386 }
385387 }
386-
387388}
You can’t perform that action at this time.
0 commit comments