Skip to content

Commit

Permalink
Namecoin: Fix missing name_op in TxOutputForUI
Browse files Browse the repository at this point in the history
This fixes an exception when displaying the transaction details dialog.
  • Loading branch information
JeremyRand committed Oct 18, 2018
1 parent 75b511b commit 09d497b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions electrum_nmc/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ class MalformedBitcoinScript(Exception):
# upstream Electrum. Based on https://stackoverflow.com/a/18348004 .


TxOutputForUI = NamedTuple("TxOutputForUI", [('address', str), ('value', int)])
TxOutputForUI = NamedTuple("TxOutputForUI", [('address', str), ('value', int), ("name_op", dict)])
TxOutputForUI.__new__.__defaults__ = (None,)
# Assume no name_op if one wasn't provided; this reduces merge conflicts from
# upstream Electrum. Based on https://stackoverflow.com/a/18348004 .


TxOutputHwInfo = NamedTuple("TxOutputHwInfo", [('address_index', Tuple),
Expand Down Expand Up @@ -1308,7 +1311,7 @@ def get_outputs_for_UI(self) -> Sequence[TxOutputForUI]:
addr = 'PUBKEY ' + o.address
else:
addr = 'SCRIPT ' + o.address
outputs.append(TxOutputForUI(addr, o.value)) # consider using yield
outputs.append(TxOutputForUI(addr, o.value, o.name_op)) # consider using yield
return outputs

def has_address(self, addr: str) -> bool:
Expand Down

0 comments on commit 09d497b

Please sign in to comment.