display and encode only hex with OP_RETURN
This commit is contained in:
@@ -66,17 +66,17 @@ class PayToEdit(ScanQRTextEdit):
|
||||
self.setStyleSheet("QWidget { background-color:#ffcccc;}")
|
||||
|
||||
def parse_address_and_amount(self, line):
|
||||
m = re.match('^OP_RETURN\s+"(.+)"$', line.strip())
|
||||
m = re.match('^OP_RETURN\s+([0-9a-fA-F]+)$', line.strip())
|
||||
if m:
|
||||
type = 'op_return'
|
||||
address = m.group(1)
|
||||
_type = 'op_return'
|
||||
address = m.group(1).decode('hex')
|
||||
amount = 0
|
||||
else:
|
||||
x, y = line.split(',')
|
||||
type = 'address'
|
||||
_type = 'address'
|
||||
address = self.parse_address(x)
|
||||
amount = self.parse_amount(y)
|
||||
return type, address, amount
|
||||
return _type, address, amount
|
||||
|
||||
|
||||
def parse_amount(self, x):
|
||||
|
||||
Reference in New Issue
Block a user