Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Resolves simplevert/#5 thanks to @yinhm.
Browse files Browse the repository at this point in the history
In certain situations the donation user will recieve 0 shares, and attempting to pay for 0 shares results in division by zero error.
  • Loading branch information
icook committed Aug 12, 2014
1 parent 3f55f8a commit 8be1218
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions simplecoin/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,9 @@ def payout(self, hash=None, simulate=False):
else:
# record the payout for each user
for user, amount in user_payouts.iteritems():
if amount == 0.0:
logger.info("Skip zero payout for USR: {}".format(user))
continue
Payout.create(user, amount, block, user_shares[user],
user_perc[user], user_perc_applied.get(user, 0),
merged_type=block.merged_type)
Expand Down

0 comments on commit 8be1218

Please sign in to comment.