fix #4032
This commit is contained in:
@@ -22,13 +22,14 @@
|
|||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
import re
|
import re
|
||||||
import dns
|
import dns
|
||||||
|
from dns.exception import DNSException
|
||||||
import json
|
import json
|
||||||
import traceback
|
import traceback
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from . import bitcoin
|
from . import bitcoin
|
||||||
from . import dnssec
|
from . import dnssec
|
||||||
from .util import export_meta, import_meta
|
from .util import export_meta, import_meta, print_error
|
||||||
|
|
||||||
|
|
||||||
class Contacts(dict):
|
class Contacts(dict):
|
||||||
@@ -96,7 +97,11 @@ class Contacts(dict):
|
|||||||
def resolve_openalias(self, url):
|
def resolve_openalias(self, url):
|
||||||
# support email-style addresses, per the OA standard
|
# support email-style addresses, per the OA standard
|
||||||
url = url.replace('@', '.')
|
url = url.replace('@', '.')
|
||||||
records, validated = dnssec.query(url, dns.rdatatype.TXT)
|
try:
|
||||||
|
records, validated = dnssec.query(url, dns.rdatatype.TXT)
|
||||||
|
except DNSException as e:
|
||||||
|
print_error('Error resolving openalias: ', str(e))
|
||||||
|
return None
|
||||||
prefix = 'btc'
|
prefix = 'btc'
|
||||||
for record in records:
|
for record in records:
|
||||||
string = record.strings[0]
|
string = record.strings[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user