|
|
|
|
@ -25,7 +25,8 @@ from jmclient import Taker, jm_single, \
|
|
|
|
|
NotEnoughFundsException, get_tumble_log, get_tumble_schedule, \ |
|
|
|
|
get_schedule, get_tumbler_parser, schedule_to_text, \ |
|
|
|
|
tumbler_filter_orders_callback, tumbler_taker_finished_update, \ |
|
|
|
|
validate_address, FidelityBondMixin |
|
|
|
|
validate_address, FidelityBondMixin, \ |
|
|
|
|
ScheduleGenerationErrorNoFunds |
|
|
|
|
from jmbase.support import get_log, utxostr_to_utxo |
|
|
|
|
|
|
|
|
|
jlog = get_log() |
|
|
|
|
@ -1177,28 +1178,15 @@ class JMWalletDaemon(Service):
|
|
|
|
|
|
|
|
|
|
jm_single().mincjamount = tumbler_options['mincjamount'] |
|
|
|
|
|
|
|
|
|
# -- Check wallet balance ------------------------------------------ |
|
|
|
|
|
|
|
|
|
max_mix_depth = tumbler_options['mixdepthsrc'] + tumbler_options['mixdepthcount'] |
|
|
|
|
|
|
|
|
|
if tumbler_options['amtmixdepths'] > max_mix_depth: |
|
|
|
|
max_mix_depth = tumbler_options['amtmixdepths'] |
|
|
|
|
|
|
|
|
|
max_mix_to_tumble = min(tumbler_options['mixdepthsrc'] + tumbler_options['mixdepthcount'], max_mix_depth) |
|
|
|
|
|
|
|
|
|
total_tumble_amount = int(0) |
|
|
|
|
for i in range(tumbler_options['mixdepthsrc'], max_mix_to_tumble): |
|
|
|
|
total_tumble_amount += self.services["wallet"].get_balance_by_mixdepth(verbose=False, minconfs=1)[i] |
|
|
|
|
|
|
|
|
|
if total_tumble_amount == 0: |
|
|
|
|
raise NotEnoughCoinsForTumbler() |
|
|
|
|
|
|
|
|
|
# -- Schedule generation ------------------------------------------- |
|
|
|
|
|
|
|
|
|
# Always generates a new schedule. No restart support for now. |
|
|
|
|
schedule = get_tumble_schedule(tumbler_options, |
|
|
|
|
try: |
|
|
|
|
schedule = get_tumble_schedule(tumbler_options, |
|
|
|
|
destaddrs, |
|
|
|
|
self.services["wallet"].get_balance_by_mixdepth()) |
|
|
|
|
except ScheduleGenerationErrorNoFunds: |
|
|
|
|
raise NotEnoughCoinsForTumbler() |
|
|
|
|
|
|
|
|
|
logsdir = os.path.join(os.path.dirname(jm_single().config_location), |
|
|
|
|
"logs") |
|
|
|
|
|