fix: Calculate balance with expired domains
All checks were successful
Build Docker / Build Images (map[dockerfile:Dockerfile.hsd tag_suffix:-hsd target:hsd]) (push) Successful in 1m14s
Build Docker / Build Images (map[dockerfile:Dockerfile tag_suffix: target:default]) (push) Successful in 1m24s
Tests and Linting / Tests-Linting (3.10) (push) Successful in 1m35s
Tests and Linting / Tests-Linting (3.11) (push) Successful in 27s
Tests and Linting / Tests-Linting (3.13) (push) Successful in 30s
All checks were successful
Build Docker / Build Images (map[dockerfile:Dockerfile.hsd tag_suffix:-hsd target:hsd]) (push) Successful in 1m14s
Build Docker / Build Images (map[dockerfile:Dockerfile tag_suffix: target:default]) (push) Successful in 1m24s
Tests and Linting / Tests-Linting (3.10) (push) Successful in 1m35s
Tests and Linting / Tests-Linting (3.11) (push) Successful in 27s
Tests and Linting / Tests-Linting (3.13) (push) Successful in 30s
This commit is contained in:
10
account.py
10
account.py
@@ -45,9 +45,7 @@ if HSD_INTERNAL_NODE:
|
|||||||
HSD_API = "firewallet-" + str(int(time.time()))
|
HSD_API = "firewallet-" + str(int(time.time()))
|
||||||
HSD_IP = "localhost"
|
HSD_IP = "localhost"
|
||||||
|
|
||||||
SHOW_EXPIRED = os.getenv("SHOW_EXPIRED")
|
SHOW_EXPIRED = os.getenv("SHOW_EXPIRED","false").lower() in ["1","true","yes"]
|
||||||
if SHOW_EXPIRED is None:
|
|
||||||
SHOW_EXPIRED = False
|
|
||||||
|
|
||||||
HSD_PROCESS = None
|
HSD_PROCESS = None
|
||||||
SPV_MODE = None
|
SPV_MODE = None
|
||||||
@@ -366,7 +364,7 @@ def getBalance(account: str):
|
|||||||
available = available / 1000000
|
available = available / 1000000
|
||||||
logger.debug(f"Initial balance for account {account}: total={total}, available={available}, locked={locked}")
|
logger.debug(f"Initial balance for account {account}: total={total}, available={available}, locked={locked}")
|
||||||
|
|
||||||
domains = getDomains(account)
|
domains = getDomains(account,True,True)
|
||||||
domainValue = 0
|
domainValue = 0
|
||||||
domains_to_update = [] # Track domains that need cache updates
|
domains_to_update = [] # Track domains that need cache updates
|
||||||
|
|
||||||
@@ -473,14 +471,14 @@ def getPendingTX(account: str):
|
|||||||
return pending
|
return pending
|
||||||
|
|
||||||
|
|
||||||
def getDomains(account, own=True):
|
def getDomains(account, own: bool = True, expired: bool = SHOW_EXPIRED):
|
||||||
if own:
|
if own:
|
||||||
response = requests.get(get_wallet_api_url(f"/wallet/{account}/name?own=true"))
|
response = requests.get(get_wallet_api_url(f"/wallet/{account}/name?own=true"))
|
||||||
else:
|
else:
|
||||||
response = requests.get(get_wallet_api_url(f"/wallet/{account}/name"))
|
response = requests.get(get_wallet_api_url(f"/wallet/{account}/name"))
|
||||||
info = response.json()
|
info = response.json()
|
||||||
|
|
||||||
if SHOW_EXPIRED:
|
if expired:
|
||||||
return info
|
return info
|
||||||
|
|
||||||
# Remove any expired domains
|
# Remove any expired domains
|
||||||
|
|||||||
Reference in New Issue
Block a user