mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-09 22:37:47 +08:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user