Skip to content

Commit

Permalink
Namecoin: Minimize single NS to string
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Dec 12, 2019
1 parent c0f4188 commit 3a84900
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions electrum_nmc/electrum/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,9 +1124,17 @@ def add_domain_record_ns(value, data):
if "ns" not in value:
value["ns"] = []

# Make sure the field is an array
if type(value["ns"]) == str:
value["ns"] = [value["ns"]]

# Add the record
value["ns"].append(data)

# Minimize to string form if possible
if len(value["ns"]) == 1:
value["ns"] = value["ns"][0]

def add_domain_record_ds(value, data):
# Make sure the field exists
if "ds" not in value:
Expand Down

0 comments on commit 3a84900

Please sign in to comment.