fix: Add new better method of validating domain owner
All checks were successful
Build Docker / Build Image (push) Successful in 1m16s
All checks were successful
Build Docker / Build Image (push) Successful in 1m16s
This commit is contained in:
12
account.py
12
account.py
@@ -449,12 +449,14 @@ def isOwnDomain(account, name: str):
|
|||||||
domain_info = getDomain(name)
|
domain_info = getDomain(name)
|
||||||
owner = getAddressFromCoin(domain_info['info']['owner']['hash'],domain_info['info']['owner']['index'])
|
owner = getAddressFromCoin(domain_info['info']['owner']['hash'],domain_info['info']['owner']['index'])
|
||||||
# Select the account
|
# Select the account
|
||||||
print(hsw.rpc_selectWallet(account))
|
hsw.rpc_selectWallet(account)
|
||||||
print(hsw.rpc_getAccount(owner))
|
account = hsw.rpc_getAccount(owner)
|
||||||
|
|
||||||
domains = getDomains(account)
|
if 'error' in account and account['error'] is not None:
|
||||||
for domain in domains:
|
return False
|
||||||
if domain['name'] == name:
|
if 'result' not in account:
|
||||||
|
return False
|
||||||
|
if account['result'] == 'default':
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user