Legacy QORA block reward fix

If there's no more unrewarded legacy QORA held,
then quickly return from Block.distributeBlockRewardToQoraHolders()
instead of causing divide-by-zero.
This commit is contained in:
catbref 2020-04-08 18:06:42 +01:00
parent 2ed2cc0fab
commit d2eb8b0c2b

View File

@ -1693,6 +1693,9 @@ public class Block {
LOGGER.trace(() -> String.format("Total legacy QORA held: %s", finalTotalQoraHeld.toPlainString()));
BigDecimal sharedAmount = BigDecimal.ZERO;
if (totalQoraHeld.signum() <= 0)
return sharedAmount;
for (int h = 0; h < qoraHolders.size(); ++h) {
AccountBalanceData qoraHolder = qoraHolders.get(h);