try:
wallet.pw_decode( wallet.seed, password)
except:
- print_error("Error: This password does not decode this wallet.")
+ print_msg("Error: This password does not decode this wallet.")
exit(1)
if cmd == 'import':
wallet.import_key(keypair,password)
wallet.save()
print_msg("Keypair imported")
- except BaseException(e):
- print_error("Error: Keypair import failed: " + str(e))
+ except BaseException as e:
+ print_msg("Error: Keypair import failed: " + str(e))
if cmd == 'help':
cmd2 = firstarg
elif cmd == 'deseed':
if not wallet.seed:
- print_error("Error: This wallet has no seed")
+ print_msg("Error: This wallet has no seed")
elif wallet.use_encryption:
- print_error("Error: This wallet is encrypted")
+ print_msg("Error: This wallet is encrypted")
else:
ns = wallet.config.path + '.seed'
print_msg("Warning: you are going to extract the seed from '%s'\nThe seed will be saved in '%s'"%(wallet.config.path,ns))
wallet.save()
print_msg("Done.")
else:
- print_error("Action canceled.")
+ print_msg("Action canceled.")
elif cmd == 'reseed':
if wallet.seed:
wallet.save()
print_msg("Done: " + wallet.config.path)
else:
- print_error("Error: Master public key does not match")
+ print_msg("Error: Master public key does not match")
elif cmd == 'validateaddress':
addr = args[1]
tx = args[1]
label = ' '.join(args[2:])
except:
- print_error("Error. Syntax: label <tx_hash> <text>")
+ print_msg("Error. Syntax: label <tx_hash> <text>")
sys.exit(1)
wallet.labels[tx] = label
wallet.save()
keypair = from_addr
from_addr = keypair.split(':')[0]
if not wallet.import_key(keypair,password):
- print_error("Error: Invalid key pair")
+ print_msg("Error: Invalid key pair")
exit(1)
wallet.history[from_addr] = interface.retrieve_history(from_addr)
wallet.update_tx_history()
elif cmd == 'signmessage':
if len(args) < 3:
- print_error("Error: Invalid usage of signmessage.")
+ print_msg("Error: Invalid usage of signmessage.")
print_msg(known_commands[cmd])
sys.exit(1)
address = args[1]
signature = args[2]
message = ' '.join(args[3:])
except:
- print_error("Error: Not all parameters were given, displaying help instead.")
+ print_msg("Error: Not all parameters were given, displaying help instead.")
print_msg(known_commands[cmd])
sys.exit(1)
if len(args) > 4: