From 8a495f4071f6158968f4a0e5188ceba169217cd7 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 26 Feb 2015 12:37:45 +0100 Subject: [PATCH] base64 encode transactions in qr codes --- gui/qt/main_window.py | 3 ++- gui/qt/transaction_dialog.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 6cabf88ed..a8f14c277 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -2240,7 +2240,8 @@ class ElectrumWindow(QMainWindow): return # else if the user scanned an offline signed tx # transactions are binary, but qrcode seems to return utf8... - z = data.decode('utf8') + import base64 + z = base64.b64decode(data.decode('utf8')) data = ''.join(chr(ord(b)) for b in z).encode('hex') tx = self.tx_from_text(data) if not tx: diff --git a/gui/qt/transaction_dialog.py b/gui/qt/transaction_dialog.py index 866057f95..ee5ce9c0b 100644 --- a/gui/qt/transaction_dialog.py +++ b/gui/qt/transaction_dialog.py @@ -108,7 +108,9 @@ class TxDialog(QDialog): def show_qr(self): + import base64 text = self.tx.raw.decode('hex') + text = base64.b64encode(text) try: self.parent.show_qrcode(text, 'Transaction') except Exception as e: