From d1c6bbe6c2c275fe8d5961e6f175e7d4de40bfbd Mon Sep 17 00:00:00 2001 From: philemon Date: Sat, 9 Aug 2014 16:51:49 +0400 Subject: [PATCH] new file: mmgen/opt/__init__.py --- mmgen/opt/__init__.py | 28 ++++++++++++++++++++++++++++ mmgen/tx.py | 21 +++++++++++---------- 2 files changed, 39 insertions(+), 10 deletions(-) create mode 100755 mmgen/opt/__init__.py diff --git a/mmgen/opt/__init__.py b/mmgen/opt/__init__.py new file mode 100755 index 00000000..03952e0c --- /dev/null +++ b/mmgen/opt/__init__.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# +# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution +# Copyright (C) 2013-2014 by philemon +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +""" +MMGen = Multi-Mode GENerator, command-line Bitcoin cold storage solution +""" +__all__ = [ + 'Opts.py', +] + +__version__ = '0.7.7' # See also below and setup.py + +# New software should look at this instead of at __version__ above. +version_info = (0, 7, 7) # See also above and setup.py diff --git a/mmgen/tx.py b/mmgen/tx.py index 261eb393..f1e62f7d 100755 --- a/mmgen/tx.py +++ b/mmgen/tx.py @@ -406,15 +406,16 @@ def parse_tx_data(tx_data,infile): try: outputs_data = eval(outputs_data) except: err_str = "mmgen-to-btc address map data" else: - from mmgen.bitcoin import b58decode - comment = b58decode(comment) - if comment == False: - err_str = "encoded comment (not base58)" - else: - if is_valid_tx_comment(comment,True): - comment = comment.decode("utf8") + if comment: + from mmgen.bitcoin import b58decode + comment = b58decode(comment) + if comment == False: + err_str = "encoded comment (not base58)" else: - err_str = "comment" + if is_valid_tx_comment(comment,True): + comment = comment.decode("utf8") + else: + err_str = "comment" if err_str: msg(err_fmt % err_str) @@ -552,8 +553,8 @@ def check_addr_data_hash(seed_id,addr_data): addr_data_chksum = make_addr_data_chksum(sorted(addr_data,key=s_addrdata)) from mmgen.addr import fmt_addr_idxs fl = fmt_addr_idxs([int(a[0]) for a in addr_data]) - msg("Computed checksum for addr data {}[{}]: {}".format( - seed_id,fl,addr_data_chksum)) + qmsg_r("Computed checksum for addr data {}[{}]: ".format(seed_id,fl)) + msg(addr_data_chksum) qmsg("Check this value against your records") def parse_addrs_file(f):