Browse Source

new file: mmgen/opt/__init__.py

philemon 10 years ago
parent
commit
d1c6bbe6c2
2 changed files with 39 additions and 10 deletions
  1. 28 0
      mmgen/opt/__init__.py
  2. 11 10
      mmgen/tx.py

+ 28 - 0
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 <mmgen-py@yandex.com>
+#
+# 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 <http://www.gnu.org/licenses/>.
+"""
+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

+ 11 - 10
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):