add option to disable dnssec
This commit is contained in:
10
lib/util.py
10
lib/util.py
@@ -467,18 +467,20 @@ import bitcoin
|
||||
from plugins import run_hook
|
||||
|
||||
class Contacts(StoreDict):
|
||||
|
||||
def __init__(self, config):
|
||||
StoreDict.__init__(self, config, 'contacts')
|
||||
|
||||
def resolve(self, k):
|
||||
def resolve(self, k, nocheck=False):
|
||||
if bitcoin.is_address(k):
|
||||
return k
|
||||
return {'address':k, 'type':'address'}
|
||||
if k in self.keys():
|
||||
_type, addr = self[k]
|
||||
if _type == 'address':
|
||||
return addr
|
||||
return {'address':addr, 'type':'contact'}
|
||||
out = run_hook('resolve_address', k)
|
||||
if out:
|
||||
if not nocheck and out.get('validated') is False:
|
||||
raise Exception("cannot validate alias")
|
||||
return out
|
||||
raise Exception("invalid Bitcoin address", k)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user