fix: Use existing hsd from accounts module to get name from hash
All checks were successful
Build Docker / Build Image (push) Successful in 2m7s

This commit is contained in:
2025-08-26 12:52:14 +10:00
parent 1c53547047
commit 49e378803d
3 changed files with 5 additions and 26 deletions

1
.gitignore vendored
View File

@@ -16,3 +16,4 @@ customPlugins/
cache/ cache/
build/ build/
dist/ dist/
hsd/

View File

@@ -4,3 +4,4 @@ THEME=black
SHOW_EXPIRED=false SHOW_EXPIRED=false
EXPLORER_TX=https://shakeshift.com/transaction/ EXPLORER_TX=https://shakeshift.com/transaction/
DISABLE_WALLETDNS=false DISABLE_WALLETDNS=false
INTERNAL_HSD=false

View File

@@ -6,30 +6,7 @@ from domainLookup import punycode_to_emoji
import os import os
from handywrapper import api from handywrapper import api
import threading import threading
import account
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)
# Get Explorer URL # Get Explorer URL
TX_EXPLORER_URL = os.getenv("EXPLORER_TX") TX_EXPLORER_URL = os.getenv("EXPLORER_TX")
@@ -559,7 +536,7 @@ def renderDomainAsync(namehash: str) -> None:
if namehash in cache: if namehash in cache:
return return
# Fetch the name outside the lock (network call) # Fetch the name outside the lock (network call)
name = hsd.rpc_getNameByHash(namehash) name = account.hsd.rpc_getNameByHash(namehash)
if name["error"] is None: if name["error"] is None:
name = name["result"] name = name["result"]
rendered = renderDomain(name) rendered = renderDomain(name)