From 49e378803d28c945ecf4b05621f1e0b8f9ac07a9 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Tue, 26 Aug 2025 12:52:14 +1000 Subject: [PATCH] fix: Use existing hsd from accounts module to get name from hash --- .gitignore | 1 + example.env | 3 ++- render.py | 27 ++------------------------- 3 files changed, 5 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 590c6aa..f73a8c4 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ customPlugins/ cache/ build/ dist/ +hsd/ diff --git a/example.env b/example.env index a096ed9..a3edcb7 100644 --- a/example.env +++ b/example.env @@ -3,4 +3,5 @@ HSD_IP=localhost THEME=black SHOW_EXPIRED=false EXPLORER_TX=https://shakeshift.com/transaction/ -DISABLE_WALLETDNS=false \ No newline at end of file +DISABLE_WALLETDNS=false +INTERNAL_HSD=false \ No newline at end of file diff --git a/render.py b/render.py index 0ddf765..847b3be 100644 --- a/render.py +++ b/render.py @@ -6,30 +6,7 @@ from domainLookup import punycode_to_emoji import os from handywrapper import api import threading - -HSD_API = os.getenv("HSD_API","") -HSD_IP = os.getenv("HSD_IP","localhost") - -HSD_NETWORK = os.getenv("HSD_NETWORK") -HSD_WALLET_PORT = 12039 -HSD_NODE_PORT = 12037 - -if not HSD_NETWORK: - HSD_NETWORK = "main" -else: - HSD_NETWORK = HSD_NETWORK.lower() - -if HSD_NETWORK == "simnet": - HSD_WALLET_PORT = 15039 - HSD_NODE_PORT = 15037 -elif HSD_NETWORK == "testnet": - HSD_WALLET_PORT = 13039 - HSD_NODE_PORT = 13037 -elif HSD_NETWORK == "regtest": - HSD_WALLET_PORT = 14039 - HSD_NODE_PORT = 14037 - -hsd = api.hsd(HSD_API, HSD_IP, HSD_NODE_PORT) +import account # Get Explorer URL TX_EXPLORER_URL = os.getenv("EXPLORER_TX") @@ -559,7 +536,7 @@ def renderDomainAsync(namehash: str) -> None: if namehash in cache: return # Fetch the name outside the lock (network call) - name = hsd.rpc_getNameByHash(namehash) + name = account.hsd.rpc_getNameByHash(namehash) if name["error"] is None: name = name["result"] rendered = renderDomain(name)