Skip to content

Commit

Permalink
Namecoin: Avoid duplicate record errors when editing a record
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Dec 12, 2019
1 parent 9478871 commit ca236fb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions electrum_nmc/electrum/gui/qt/configure_dns_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,10 @@ def create_import_record(self):
self.ui.editIMPORTSubdomain.setText("")

def has_freenet_record(self, domain):
for record in self.get_records():
for index, record in enumerate(self.get_records()):
if index == self.editing_row:
continue

record_domain, record_type, data = record

if record_domain == domain and record_type == "address" and data[0] == "freenet":
Expand All @@ -380,7 +383,10 @@ def has_freenet_record(self, domain):
return False

def has_zeronet_record(self, domain):
for record in self.get_records():
for index, record in enumerate(self.get_records()):
if index == self.editing_row:
continue

record_domain, record_type, data = record

if record_domain == domain and record_type == "address" and data[0] == "zeronet":
Expand All @@ -389,7 +395,10 @@ def has_zeronet_record(self, domain):
return False

def has_cname_record(self, domain):
for record in self.get_records():
for index, record in enumerate(self.get_records()):
if index == self.editing_row:
continue

record_domain, record_type, data = record

if record_domain == domain and record_type == "cname":
Expand Down

0 comments on commit ca236fb

Please sign in to comment.