Skip to content

Commit

Permalink
Namecoin: properly handle None argument to split_name_script
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Oct 1, 2018
1 parent 901be4b commit f5332b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions electrum_nmc/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
# SOFTWARE.

def split_name_script(decoded):
# This case happens if a script was malformed and couldn't be decoded by
# transaction.get_address_from_output_script.
if decoded is None:
return {"name_op": None, "address_scriptPubKey": decoded}

# So, Namecoin Core uses OP_0 when pushing an empty string as a (value).
# Unfortunately, Electrum doesn't match OP_0 when using OP_PUSHDATA4 as a
# data push opcode wildcard. So we have to check for OP_0 separately,
Expand Down

0 comments on commit f5332b6

Please sign in to comment.