mirror of
https://github.com/lalanza808/monero.fail.git
synced 2025-08-21 01:38:14 -04:00
add some logic to deduce if node is monero
This commit is contained in:
parent
137a95217d
commit
62b4f391f4
1 changed files with 12 additions and 0 deletions
12
xmrnodes/helpers.py
Normal file
12
xmrnodes/helpers.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
from requests import get as r_get
|
||||
|
||||
def is_monero(url):
|
||||
data = {"method": "get_block_header_by_height", "params": {"height": 0}}
|
||||
try:
|
||||
r = r_get(url + "/json_rpc", json=data)
|
||||
r.raise_for_status()
|
||||
assert "result" in r.json()
|
||||
is_xmr = r.json()["result"]["block_header"]["hash"] == "418015bb9ae982a1975da7d79277c2705727a56894ba0fb246adaabb1f4632e3"
|
||||
return is_xmr
|
||||
except:
|
||||
return False
|
Loading…
Add table
Add a link
Reference in a new issue