mirror of
https://github.com/cryptoadvance/specter-desktop.git
synced 2026-08-13 12:33:29 +02:00
Expose internal node to localhost only (#2455)
* Remove unused import * Comparison to None, True should be 'if cond is None:' * Expose internal node to localhost only
This commit is contained in:
parent
e0eccac741
commit
db3df46d2a
2 changed files with 10 additions and 16 deletions
|
|
@ -70,17 +70,14 @@ class ElementsPlainController(NodePlainController):
|
|||
btcd_cmd += " -validatepegin=0 "
|
||||
btcd_cmd += " -txindex=1 "
|
||||
btcd_cmd += " -initialfreecoins=2100000000000000 "
|
||||
btcd_cmd += " -port={} -rpcport={} -rpcbind=0.0.0.0".format(
|
||||
rpcconn.rpcport + 1, rpcconn.rpcport
|
||||
)
|
||||
btcd_cmd += " -port={} -rpcport={}".format(rpcconn.rpcport + 1, rpcconn.rpcport)
|
||||
btcd_cmd += " -rpcuser={} -rpcpassword={} ".format(
|
||||
rpcconn.rpcuser, rpcconn.rpcpassword
|
||||
)
|
||||
btcd_cmd += " -rpcallowip=0.0.0.0/0 -rpcallowip=172.17.0.0/16 "
|
||||
if not run_docker:
|
||||
if not log_stdout:
|
||||
btcd_cmd += " -noprinttoconsole"
|
||||
if datadir == None:
|
||||
if datadir is None:
|
||||
datadir = tempfile.mkdtemp(prefix="bitcoind_datadir")
|
||||
btcd_cmd += ' -datadir="{}" '.format(datadir)
|
||||
print(f"extra_args={extra_args})")
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
""" Stuff to control a bitcoind-instance.
|
||||
"""
|
||||
|
||||
import atexit
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import shutil
|
||||
import signal
|
||||
import subprocess
|
||||
|
|
@ -48,7 +48,7 @@ class Btcd_conn:
|
|||
|
||||
@property
|
||||
def ipaddress(self):
|
||||
if self._ipaddress == None:
|
||||
if self._ipaddress is None:
|
||||
raise Exception("ipadress is none")
|
||||
else:
|
||||
return self._ipaddress
|
||||
|
|
@ -73,7 +73,7 @@ class Btcd_conn:
|
|||
return rpc
|
||||
|
||||
def render_url(self, password_mask=False):
|
||||
if password_mask == True:
|
||||
if password_mask is True:
|
||||
password = "xxxxxx"
|
||||
else:
|
||||
password = self.rpcpassword
|
||||
|
|
@ -226,7 +226,7 @@ class NodeController:
|
|||
|
||||
def mine(self, address=None, block_count=1):
|
||||
"""Does mining to the attached address with as many as block_count blocks"""
|
||||
if address == None:
|
||||
if address is None:
|
||||
if self.node_impl == "bitcoin":
|
||||
address = "mruae2834buqxk77oaVpephnA5ZAxNNJ1r"
|
||||
else:
|
||||
|
|
@ -358,17 +358,14 @@ class NodeController:
|
|||
if network != "mainnet" and network != "main":
|
||||
btcd_cmd += " -{} ".format(network)
|
||||
btcd_cmd += " -fallbackfee=0.0002 "
|
||||
btcd_cmd += " -port={} -rpcport={} -rpcbind=0.0.0.0 -rpcbind=0.0.0.0".format(
|
||||
rpcconn.rpcport - 1, rpcconn.rpcport
|
||||
)
|
||||
btcd_cmd += " -port={} -rpcport={}".format(rpcconn.rpcport - 1, rpcconn.rpcport)
|
||||
btcd_cmd += " -rpcuser={} -rpcpassword={} ".format(
|
||||
rpcconn.rpcuser, rpcconn.rpcpassword
|
||||
)
|
||||
btcd_cmd += " -rpcallowip=0.0.0.0/0 -rpcallowip=172.17.0.0/16 "
|
||||
if not run_docker:
|
||||
if not log_stdout:
|
||||
btcd_cmd += " -noprinttoconsole"
|
||||
if datadir == None:
|
||||
if datadir is None:
|
||||
datadir = tempfile.mkdtemp(prefix="bitcoind_datadir")
|
||||
btcd_cmd += ' -datadir="{}" '.format(datadir)
|
||||
if extra_args:
|
||||
|
|
@ -412,7 +409,7 @@ class NodePlainController(NodeController):
|
|||
log_stdout=False,
|
||||
extra_args=[],
|
||||
):
|
||||
if datadir == None:
|
||||
if datadir is None:
|
||||
datadir = tempfile.mkdtemp(
|
||||
prefix=f"specter_{self.node_impl}_regtest_plain_datadir_"
|
||||
)
|
||||
|
|
@ -484,7 +481,7 @@ class NodePlainController(NodeController):
|
|||
if not hasattr(self, "datadir"):
|
||||
self.datadir = None
|
||||
|
||||
if cleanup_hard == None:
|
||||
if cleanup_hard is None:
|
||||
cleanup_hard = self.cleanup_hard
|
||||
if not hasattr(self, "node_proc"):
|
||||
logger.info("node process was not running")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue