commit cfa833134a832f83957a4d336b86da6c6bb5da9b
parent 8fa1a9a5a83d75c8ef362bac9b02c3d6c061b555
Author: ThomasV <thomasv1@gmx.de>
Date: Sun, 7 Sep 2014 18:43:58 +0200
Merge pull request #824 from dabura667/txdiagopret
Show op_return in tx dialogue
Diffstat:
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/gui/qt/transaction_dialog.py b/gui/qt/transaction_dialog.py
@@ -212,7 +212,7 @@ class TxDialog(QDialog):
vbox.addWidget(i_text)
vbox.addWidget(QLabel(_("Outputs")))
- lines = map(lambda x: x[0] + u'\t\t' + self.parent.format_amount(x[1]), self.tx.get_outputs())
+ lines = map(lambda x: x[0] + u'\t\t' + self.parent.format_amount(x[1]) if x[1] else x[0], self.tx.get_outputs())
o_text = QTextEdit()
o_text.setText('\n'.join(lines))
o_text.setReadOnly(True)
diff --git a/lib/transaction.py b/lib/transaction.py
@@ -429,6 +429,11 @@ def get_address_from_output_script(bytes):
if match_decoded(decoded, match):
return 'address', hash_160_to_bc_address(decoded[1][1],5)
+ # OP_RETURN
+ match = [ opcodes.OP_RETURN, opcodes.OP_PUSHDATA4 ]
+ if match_decoded(decoded, match):
+ return 'op_return', decoded[1][1]
+
return "(None)", "(None)"
@@ -765,6 +770,11 @@ class Transaction:
addr = x
elif type == 'pubkey':
addr = public_key_to_bc_address(x.decode('hex'))
+ elif type == 'op_return':
+ try:
+ addr = 'OP_RETURN: "' + x.decode('utf8') + '"'
+ except:
+ addr = 'OP_RETURN: "' + x.encode('hex') + '"'
else:
addr = "(None)"
o.append((addr,v))