1
0

add option to disable dnssec

This commit is contained in:
ThomasV
2015-05-31 16:43:27 +02:00
parent 9be94c74d2
commit a3cd33fe03
3 changed files with 50 additions and 31 deletions

View File

@@ -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)