Beispiel #1
0
infiles = opt.opts.init(opts_data,add_opts=["b16"])

#if opt.from_incog_hex or opt.from_incog_hidden: opt.from_incog = True

if not infiles: opt.opts.usage()
for i in infiles: check_infile(i)

c = connect_to_bitcoind()

saved_seeds = {}
tx_files   = [i for i in infiles if get_extension(i) == g.rawtx_ext]
seed_files = [i for i in infiles if get_extension(i) != g.rawtx_ext]

if not opt.info and not opt.terse_info:
	do_license_msg(immed=True)

from_file = { 'mmdata':{}, 'kldata':{} }
if opt.mmgen_keys_from_file:
	from_file['mmdata'] = parse_mmgen_keyaddr_file() or {}
if opt.keys_from_file:
	from_file['kldata'] = parse_keylist(from_file) or {}

tx_num_str = ""
for tx_num,tx_file in enumerate(tx_files,1):
	if len(tx_files) > 1:
		msg("\nTransaction #%s of %s:" % (tx_num,len(tx_files)))
		tx_num_str = " #%s" % tx_num

	m = "" if opt.tx_id else "transaction data"
	tx_data = get_lines_from_file(tx_file,m)
Beispiel #2
0
	)
}

cmd_args = opt.opts.init(opts_data,opt_filter=opt_filter)

if len(cmd_args) < nargs \
		and not opt.hidden_incog_input_params and not opt.in_fmt:
	die(1,"An input file or input format must be specified")
elif len(cmd_args) > nargs \
		or (len(cmd_args) == nargs and opt.hidden_incog_input_params):
	msg("No input files may be specified" if invoked_as == "gen"
			else "Too many input files specified")
	opt.opts.usage()

if cmd_args: check_infile(cmd_args[0])

if not invoked_as == "chk": do_license_msg()

if invoked_as in ("conv","passchg"): msg(green("Processing input wallet"))

ss_in = None if invoked_as == "gen" \
			else SeedSource(*cmd_args,passchg=invoked_as=="passchg")

if invoked_as == "chk":
	sys.exit()

if invoked_as in ("conv","passchg"): msg(green("Processing output wallet"))

ss_out = SeedSource(ss=ss_in,passchg=invoked_as=="passchg")
ss_out.write_to_file()