Skip to content

Commit

Permalink
openalias: only consider TXT records, as DNS can return other records…
Browse files Browse the repository at this point in the history
… we did not ask for.
  • Loading branch information
accumulator committed Oct 8, 2024
1 parent f471356 commit db865f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions electrum/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ def _resolve_openalias(cls, url: str) -> Optional[Tuple[str, str, bool]]:
return None
prefix = 'btc'
for record in records:
if record.rdtype != dns.rdatatype.TXT:
continue
string = to_string(record.strings[0], 'utf8')
if string.startswith('oa1:' + prefix):
address = cls.find_regex(string, r'recipient_address=([A-Za-z0-9]+)')
Expand Down

0 comments on commit db865f6

Please sign in to comment.