undeath 7 years ago
parent
commit
4f23647954
  1. 17
      jmclient/jmclient/wallet_utils.py
  2. 7
      scripts/tumbler.py

17
jmclient/jmclient/wallet_utils.py

@ -31,10 +31,7 @@ def get_wallettool_parser():
'(importprivkey) Adds privkeys to this wallet, privkeys are spaces or commas separated.\n'
'(dumpprivkey) Export a single private key, specify an hd wallet path\n'
'(signmessage) Sign a message with the private key from an address in \n'
'the wallet. Use with -H and specify an HD wallet path for the address.\n'
'(changemixdepth) Use with -M to change the *maximum* number of mixdepths\n'
'in the wallet; you are advised to only increase, not decrease this \n'
'number from the current value (initially 5).')
'the wallet. Use with -H and specify an HD wallet path for the address.')
parser = OptionParser(usage='usage: %prog [options] [wallet file] [method]',
description=description)
parser.add_option('-p',
@ -855,11 +852,6 @@ def get_wallet_cls(wtype=None):
return cls
def change_wallet_mixdepth(wallet, max_mixdepth):
wallet.max_mixdepth = max_mixdepth
wallet.save()
return "Maximum mixdepth successfully updated."
def create_wallet(path, password, max_mixdepth, wallet_cls=None, **kwargs):
storage = Storage(path, password, create=True)
wallet_cls = wallet_cls or get_wallet_cls()
@ -986,8 +978,7 @@ def wallet_tool_main(wallet_root_path):
methods = ['display', 'displayall', 'summary', 'showseed', 'importprivkey',
'history', 'showutxos']
methods.extend(noseed_methods)
noscan_methods = ['showseed', 'importprivkey', 'dumpprivkey',
'signmessage', 'changemixdepth']
noscan_methods = ['showseed', 'importprivkey', 'dumpprivkey', 'signmessage']
readonly_methods = ['display', 'displayall', 'summary', 'showseed',
'history', 'showutxos', 'dumpprivkey', 'signmessage']
@ -1054,10 +1045,6 @@ def wallet_tool_main(wallet_root_path):
return "Key import completed."
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)
#Testing (can port to test modules, TODO)

7
scripts/tumbler.py

@ -32,13 +32,6 @@ def main():
max_mix_depth = options['mixdepthsrc'] + options['mixdepthcount']
wallet_path = get_wallet_path(wallet_name, None)
wallet = open_test_wallet_maybe(wallet_path, wallet_name, max_mix_depth)
if wallet.max_mixdepth < max_mix_depth:
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 + 1, " (yourwalletname) changemixdepth")
print("Then start the tumbler again with the same settings.")
sys.exit(0)
if jm_single().config.get("BLOCKCHAIN",
"blockchain_source") == "electrum-server":
jm_single().bc_interface.synctype = "with-script"

Loading…
Cancel
Save