diff --git a/render.py b/render.py index 308639d..680982b 100644 --- a/render.py +++ b/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("