Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
Let empty_wizard_accounts terminate
Browse files Browse the repository at this point in the history
  • Loading branch information
konradkonrad committed May 18, 2020
1 parent 6632db8 commit 2a0b351
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/empty_wizard_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def collect_balances(self, address):
f"\tUDC: {udc_balance}\n"
)
self.accounts_with_balance.append(address)
self.accounts_with_balance = list(set(self.accounts_with_balance))

def unlock_accounts_with_balance(self):
known_passwords = set()
Expand Down Expand Up @@ -174,11 +175,13 @@ def sweep(self):

def work_left(self):
if any(not self.udc_empty(address) for address in self.accounts_with_balance):
print(f"Draining UDC")
return True
for address in self.accounts_with_balance:
if address.lower() == self.receiver.lower():
continue
if self.has_any_balance_left(address):
print(f"continuing to drain {address}:")
return True
return False

Expand Down

0 comments on commit 2a0b351

Please sign in to comment.