Skip to content

Commit

Permalink
Namecoin: Minimize single IPv6 to string
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Dec 12, 2019
1 parent 54b41bb commit c0f4188
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 @@ -1076,9 +1076,17 @@ def add_domain_record_address_ip6(value, data):
if "ip6" not in value:
value["ip6"] = []

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

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

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

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

0 comments on commit c0f4188

Please sign in to comment.