fixes issue in subdomain lookups for addresses in regtest mode- the subdomain registrar isn't 'regtest-aware', so it submits mainnet addresses, therefore the address shouldn't be converted in the lookup for subdomains

This commit is contained in:
Aaron Blankstein
2017-08-15 14:51:05 -04:00
parent 31918a820b
commit 6d217b1ce0

View File

@@ -577,18 +577,19 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
if blockchain != 'bitcoin':
return self._reply_json({'error': 'Invalid blockchain'}, status_code=401)
# make sure we have the right encoding
new_addr = virtualchain.address_reencode(str(address))
if new_addr != address:
log.debug("Re-encode {} to {}".format(new_addr, address))
address = new_addr
address = str(address)
subdomain_names = subdomains.get_subdomains_owned_by_address(address)
if json_is_error(subdomain_names):
log.error("Failed to fetch subdomains owned by address")
log.error(subdomain_names)
subdomain_names = []
# make sure we have the right encoding
new_addr = virtualchain.address_reencode(address)
if new_addr != address:
log.debug("Re-encode {} to {}".format(new_addr, address))
address = new_addr
res = proxy.get_names_owned_by_address(address)
if json_is_error(res):
log.error("Failed to get names owned by address")