mirror of
https://github.com/lalanza808/monero.fail.git
synced 2025-04-21 09:06:29 -04:00
fix faulty logic in nodes api. show only available, include i2p nodes
This commit is contained in:
parent
e98f928ce3
commit
5edea648b4
@ -8,21 +8,24 @@ bp = Blueprint('api', 'api')
|
||||
@bp.route("/nodes.json")
|
||||
def nodes_json():
|
||||
nodes = Node.select().where(
|
||||
Node.validated==True
|
||||
).where(
|
||||
Node.validated==True,
|
||||
Node.available==True,
|
||||
Node.nettype=="mainnet"
|
||||
)
|
||||
xmr_nodes = [n for n in nodes if n.crypto == "monero"]
|
||||
wow_nodes = [n for n in nodes if n.crypto == "wownero"]
|
||||
return jsonify({
|
||||
"monero": {
|
||||
"clear": [n.url for n in xmr_nodes if n.is_tor == False],
|
||||
"clear": [n.url for n in xmr_nodes if n.is_tor == False and n.is_i2p == False],
|
||||
"onion": [n.url for n in xmr_nodes if n.is_tor == True],
|
||||
"i2p": [n.url for n in xmr_nodes if n.is_i2p == True],
|
||||
"web_compatible": [n.url for n in xmr_nodes if n.web_compatible == True],
|
||||
},
|
||||
"wownero": {
|
||||
"clear": [n.url for n in wow_nodes if n.is_tor == False],
|
||||
"onion": [n.url for n in wow_nodes if n.is_tor == True]
|
||||
"clear": [n.url for n in wow_nodes if n.is_tor == False and n.is_i2p == False],
|
||||
"onion": [n.url for n in wow_nodes if n.is_tor == True],
|
||||
"i2p": [n.url for n in wow_nodes if n.is_i2p == True],
|
||||
"web_compatible": [n.url for n in wow_nodes if n.web_compatible == True],
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user