mirror of
https://github.com/lalanza808/monero.fail.git
synced 2025-08-19 15:17:47 -04:00
add more logic for monero checking and simple html table
This commit is contained in:
parent
62b4f391f4
commit
2faf28808f
4 changed files with 33 additions and 7 deletions
|
@ -7,6 +7,7 @@ from datetime import datetime
|
|||
from flask import Flask, request, redirect
|
||||
from flask import render_template, flash, url_for
|
||||
from urllib.parse import urlparse
|
||||
from xmrnodes.helpers import is_monero
|
||||
from xmrnodes.forms import SubmitNode
|
||||
from xmrnodes.models import Node
|
||||
|
||||
|
@ -65,7 +66,7 @@ def add():
|
|||
if Node.select().where(Node.url == url).exists():
|
||||
flash("This node is already in the database.")
|
||||
else:
|
||||
flash("Seems like a valid node. Added to the database and will check soon.")
|
||||
flash("Seems like a valid node URL. Added to the database and will check soon.")
|
||||
node = Node(url=url)
|
||||
node.save()
|
||||
return redirect("/")
|
||||
|
@ -79,7 +80,7 @@ def validate():
|
|||
logging.info(f"Attempting to validate {node.url}")
|
||||
if is_onion:
|
||||
logging.info("onion address found")
|
||||
node.tor = True
|
||||
node.is_tor = True
|
||||
try:
|
||||
r = requests.get(node.url + "/get_info", timeout=3)
|
||||
r.raise_for_status()
|
||||
|
@ -92,6 +93,7 @@ def validate():
|
|||
node.available = True
|
||||
node.validated = True
|
||||
node.datetime_checked = now
|
||||
node.is_monero = is_monero(node.url)
|
||||
node.save()
|
||||
else:
|
||||
logging.info("unexpected nettype")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue