From db865f6f728ff36a154973dc2d7147da0543b7cc Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Tue, 8 Oct 2024 11:57:23 +0200 Subject: [PATCH] openalias: only consider TXT records, as DNS can return other records we did not ask for. --- electrum/contacts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/electrum/contacts.py b/electrum/contacts.py index 019d0964d..c7b06cca9 100644 --- a/electrum/contacts.py +++ b/electrum/contacts.py @@ -148,6 +148,8 @@ class Contacts(dict, Logger): 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]+)')