use base43 in order to send transactions by QR code
This commit is contained in:
@@ -2240,8 +2240,8 @@ class ElectrumWindow(QMainWindow):
|
||||
return
|
||||
# else if the user scanned an offline signed tx
|
||||
# transactions are binary, but qrcode seems to return utf8...
|
||||
import base64
|
||||
z = base64.b64decode(data.decode('utf8'))
|
||||
data = data.decode('utf8')
|
||||
z = bitcoin.base_decode(data, length=None, base=43)
|
||||
data = ''.join(chr(ord(b)) for b in z).encode('hex')
|
||||
tx = self.tx_from_text(data)
|
||||
if not tx:
|
||||
|
||||
@@ -34,6 +34,7 @@ from PyQt4.QtCore import *
|
||||
import PyQt4.QtCore as QtCore
|
||||
|
||||
from electrum import transaction
|
||||
from electrum.bitcoin import base_encode
|
||||
from electrum.plugins import run_hook
|
||||
|
||||
from util import MyTreeWidget
|
||||
@@ -108,9 +109,8 @@ class TxDialog(QDialog):
|
||||
|
||||
|
||||
def show_qr(self):
|
||||
import base64
|
||||
text = self.tx.raw.decode('hex')
|
||||
text = base64.b64encode(text)
|
||||
text = base_encode(text, base=43)
|
||||
try:
|
||||
self.parent.show_qrcode(text, 'Transaction')
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user