From 6a26e48defcf78f9e4cabcdad5c92a2c3104c49e Mon Sep 17 00:00:00 2001 From: AdamISZ Date: Fri, 28 Sep 2018 13:12:25 +0200 Subject: [PATCH] Disallow less than 1 mixdepth in changemixdepth. Maxmixdepth error msg in tumbler: fix off-by-one bugfix md num --- jmclient/jmclient/wallet_utils.py | 2 ++ scripts/tumbler.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/jmclient/jmclient/wallet_utils.py b/jmclient/jmclient/wallet_utils.py index 5d209a4..7bdbfe1 100644 --- a/jmclient/jmclient/wallet_utils.py +++ b/jmclient/jmclient/wallet_utils.py @@ -1054,6 +1054,8 @@ def wallet_tool_main(wallet_root_path): elif method == "signmessage": return wallet_signmessage(wallet, options.hd_path, args[2]) elif method == 'changemixdepth': + if options.mixdepth < 1: + return "Number of mixdepths must be at least 1" return change_wallet_mixdepth(wallet, options.mixdepth-1) diff --git a/scripts/tumbler.py b/scripts/tumbler.py index b124e6c..e67577d 100644 --- a/scripts/tumbler.py +++ b/scripts/tumbler.py @@ -38,7 +38,7 @@ def main(): print("Your wallet does not contain the required number of mixdepths: ", max_mix_depth) print("Increase using this command: `python wallet-tool.py -m ", - max_mix_depth, " (yourwalletname) changemixdepth") + max_mix_depth + 1, " (yourwalletname) changemixdepth") print("Then start the tumbler again with the same settings.") sys.exit(0) if jm_single().config.get("BLOCKCHAIN",