Compare commits
4 Commits
feat/aucti
...
1d5ed059b3
| Author | SHA1 | Date | |
|---|---|---|---|
|
1d5ed059b3
|
|||
|
747ac575fa
|
|||
|
e574933302
|
|||
|
c0f0dc5010
|
@@ -867,10 +867,12 @@ def rescan_auction(account, domain):
|
||||
return {
|
||||
"error": "Invalid domain"
|
||||
}
|
||||
if 'bidPeriodStart' not in response['result']['info']['stats']:
|
||||
if 'height' not in response['result']['info']:
|
||||
return {
|
||||
"error": "Not in auction"
|
||||
"error": "Can't find start"
|
||||
}
|
||||
|
||||
|
||||
height = response['result']['info']['height']-1
|
||||
response = hsw.rpc_importName(domain, height)
|
||||
return response
|
||||
|
||||
22
render.py
22
render.py
@@ -40,6 +40,24 @@ if TX_EXPLORER_URL is None:
|
||||
|
||||
|
||||
NAMEHASH_CACHE = 'user_data/namehash_cache.json'
|
||||
# Validate cache version
|
||||
if os.path.exists(NAMEHASH_CACHE):
|
||||
with open(NAMEHASH_CACHE, 'r') as f:
|
||||
cache = json.load(f)
|
||||
if not isinstance(cache, dict):
|
||||
print("Invalid namehash cache format. Resetting cache.")
|
||||
with open(NAMEHASH_CACHE, 'w') as f:
|
||||
json.dump({}, f)
|
||||
# Check if cache entries are valid
|
||||
for key in cache:
|
||||
if not cache[key].startswith("<a href='/manage/"):
|
||||
print(f"Invalid cache entry for {key}. Resetting cache.")
|
||||
with open(NAMEHASH_CACHE, 'w') as f:
|
||||
json.dump({}, f)
|
||||
break
|
||||
|
||||
|
||||
|
||||
CACHE_LOCK = threading.Lock()
|
||||
|
||||
|
||||
@@ -330,7 +348,7 @@ def bids(bids,reveals):
|
||||
else:
|
||||
html += f"<td>Unknown</td>"
|
||||
|
||||
html += f"<td><a class='text-decoration-none' style='color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));' href='{TX_EXPLORER_URL}{bid['prevout']['hash']}'>Bid TX 🔗</a></td>"
|
||||
html += f"<td><a class='text-decoration-none' style='color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));' target='_blank' href='{TX_EXPLORER_URL}{bid['prevout']['hash']}'>Bid TX 🔗</a></td>"
|
||||
html += "</tr>"
|
||||
|
||||
return html
|
||||
@@ -547,6 +565,8 @@ def renderDomainAsync(namehash: str) -> None:
|
||||
if name["error"] is None:
|
||||
name = name["result"]
|
||||
rendered = renderDomain(name)
|
||||
rendered = f"<a href='/manage/{name}' target='_blank' style='color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));'>{rendered}</a>"
|
||||
|
||||
|
||||
with CACHE_LOCK:
|
||||
with open(NAMEHASH_CACHE, 'r') as f:
|
||||
|
||||
Reference in New Issue
Block a user