From 97c99c8912872278c11c3b78e81bbecc8f5d96c6 Mon Sep 17 00:00:00 2001 From: roshii Date: Tue, 12 Nov 2019 20:24:14 +0100 Subject: [PATCH] Bug fix to allow schedule use --- scripts/sendpayment.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/sendpayment.py b/scripts/sendpayment.py index 12e680884..f994b586a 100644 --- a/scripts/sendpayment.py +++ b/scripts/sendpayment.py @@ -85,13 +85,14 @@ def main(): log.error("Failed to load schedule file, quitting. Check the syntax.") log.error("Error was: " + str(schedule)) sys.exit(0) - mixdepth = 0 - for s in schedule: - if s[1] == 0: - sweeping = True - #only used for checking the maximum mixdepth required - mixdepth = max([mixdepth, s[0]]) + mixdepth = schedule[0][0] + amount = schedule[0][1] + options.makercount = schedule[0][2] + destaddr = schedule[0][3] + if amount == 0: + sweeping = True + wallet_name = args[0] check_regtest() @@ -146,7 +147,7 @@ def main(): # significant value compared the the cj amount total_cj_amount = amount if total_cj_amount == 0: - total_cj_amount = wallet_service.get_balance_by_mixdepth()[options.mixdepth] + total_cj_amount = wallet_service.get_balance_by_mixdepth()[mixdepth] if total_cj_amount == 0: raise ValueError("No confirmed coins in the selected mixdepth. Quitting") exp_tx_fees_ratio = ((1 + options.makercount) * options.txfee) / total_cj_amount