Skip to content

Commit

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

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

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

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

def add_domain_record_address_freenet(value, data):
# Make sure the field doesn't already exist
if "freenet" in value:
Expand Down

0 comments on commit adc3d8d

Please sign in to comment.