base64 encode transactions in qr codes
This commit is contained in:
@@ -2240,7 +2240,8 @@ class ElectrumWindow(QMainWindow):
|
|||||||
return
|
return
|
||||||
# else if the user scanned an offline signed tx
|
# else if the user scanned an offline signed tx
|
||||||
# transactions are binary, but qrcode seems to return utf8...
|
# 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')
|
data = ''.join(chr(ord(b)) for b in z).encode('hex')
|
||||||
tx = self.tx_from_text(data)
|
tx = self.tx_from_text(data)
|
||||||
if not tx:
|
if not tx:
|
||||||
|
|||||||
@@ -108,7 +108,9 @@ class TxDialog(QDialog):
|
|||||||
|
|
||||||
|
|
||||||
def show_qr(self):
|
def show_qr(self):
|
||||||
|
import base64
|
||||||
text = self.tx.raw.decode('hex')
|
text = self.tx.raw.decode('hex')
|
||||||
|
text = base64.b64encode(text)
|
||||||
try:
|
try:
|
||||||
self.parent.show_qrcode(text, 'Transaction')
|
self.parent.show_qrcode(text, 'Transaction')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user