mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
Set trusted-daemon for XMR node in basicswap.json
basicswap-prepare will set trusted_daemon true if the daemon host address is a local ip address else false. Override with --trustremotenode --trustremotenode can be used with --enabletor
This commit is contained in:
17
basicswap/util/network.py
Normal file
17
basicswap/util/network.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (c) 2024 tecnovert
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
import ipaddress
|
||||
|
||||
|
||||
def is_private_ip_address(addr: str):
|
||||
# Will return false for all URLs
|
||||
if addr == 'localhost':
|
||||
return True
|
||||
try:
|
||||
return ipaddress.ip_address(addr).is_private
|
||||
except Exception:
|
||||
return False
|
||||
Reference in New Issue
Block a user