mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 20:21:35 +00:00
Fix simplify read pubkey from file
This commit is contained in:
parent
3af8287da7
commit
84ea69344e
14
api/utils.py
14
api/utils.py
@ -143,21 +143,21 @@ def get_devfund_pubkey(network: str) -> str:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
session = get_session()
|
session = get_session()
|
||||||
url = "https://raw.githubusercontent.com/RoboSats/robosats/main/devfund_pubkey.json"
|
url = "https://raw.githubusercontent.com/RoboSats/robosats/main/devfund_pubey.json"
|
||||||
# hardcoded fallback
|
|
||||||
mainnet = "02187352cc4b1856b9604e0a79e1bc9b301be7e0c14acbbb8c29f7051d507127d7"
|
|
||||||
testnet = "03ecb271b3e2e36f2b91c92c65bab665e5165f8cdfdada1b5f46cfdd3248c87fd6"
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = session.get(url)
|
response = session.get(url)
|
||||||
response.raise_for_status() # Raises stored HTTPError, if one occurred
|
response.raise_for_status() # Raises stored HTTPError, if one occurred
|
||||||
value = response.json().get(network)
|
value = response.json().get(network)
|
||||||
if len(value) == 66:
|
if len(value) != 66:
|
||||||
return value
|
raise Exception()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
with open("devfund_pubkey.json", "r") as f:
|
||||||
|
data = json.load(f)
|
||||||
|
value = data.get(network)
|
||||||
|
|
||||||
return mainnet if network == "mainnet" else testnet
|
return value
|
||||||
|
|
||||||
|
|
||||||
market_cache = {}
|
market_cache = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user