Skip to content

Commit

Permalink
Namecoin: Minimize single TXT to string
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Dec 12, 2019
1 parent 3a84900 commit fa06413
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 @@ -1168,9 +1168,17 @@ def add_domain_record_txt(value, data):
if "txt" not in value:
value["txt"] = []

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

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

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

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

0 comments on commit fa06413

Please sign in to comment.