mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-19 01:40:55 +01:00
Add guard to not allow us to check the network configuration on bitcoind (#3582)
* Add guard to not allow us to check the network configuration on bitcoind if we are using tor because tor isn't started yet * Remove unecessary logs, revert config
This commit is contained in:
parent
54ce2ebeb2
commit
e62615dc5e
@ -52,11 +52,19 @@ class LandingPaneModel(serverArgParser: ServerArgParser)(implicit
|
||||
// know what network it is on now
|
||||
Future.successful(ConfigFactory.empty())
|
||||
case BitcoindBackend =>
|
||||
tmpConf.bitcoindRpcConf.client.getBlockChainInfo.map { info =>
|
||||
val networkStr =
|
||||
DatadirUtil.networkStrToDirName(info.chain.name)
|
||||
ConfigFactory.parseString(s"bitcoin-s.network = $networkStr")
|
||||
if (!appConfig.torConf.enabled) {
|
||||
tmpConf.bitcoindRpcConf.client.getBlockChainInfo.map { info =>
|
||||
val networkStr =
|
||||
DatadirUtil.networkStrToDirName(info.chain.name)
|
||||
ConfigFactory.parseString(s"bitcoin-s.network = $networkStr")
|
||||
}
|
||||
} else {
|
||||
//we cannot connect to bitcoind and determine
|
||||
//the network over tor since tor isn't started
|
||||
//yet
|
||||
Future.successful(ConfigFactory.empty())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
netConfF.map { netConf =>
|
||||
@ -82,7 +90,6 @@ class LandingPaneModel(serverArgParser: ServerArgParser)(implicit
|
||||
GlobalData.setBitcoinNetwork(
|
||||
finalAppConfig.network,
|
||||
finalAppConfig.socks5ProxyParams.isDefined)
|
||||
|
||||
new BitcoinSServerMain(serverArgParser)(system, finalAppConfig)
|
||||
.run()
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ class BitcoinSServerMain(override val serverArgParser: ServerArgParser)(implicit
|
||||
implicit lazy val torConf: TorAppConfig = conf.torConf
|
||||
|
||||
override def start(): Future[Unit] = {
|
||||
logger.info("Starting appServer")
|
||||
val startedConfigF = conf.start()
|
||||
|
||||
logger.info(s"Start on network ${walletConf.network}")
|
||||
|
@ -41,6 +41,7 @@ case class TorAppConfig(
|
||||
override def start(): Future[Unit] = {
|
||||
lazy val torRunning = checkIfTorAlreadyRunning
|
||||
if (enabled && !isStarted.get && !torRunning) {
|
||||
logger.info(s"Starting tor")
|
||||
isStarted.set(true)
|
||||
val start = System.currentTimeMillis()
|
||||
//remove old tor log file so we accurately tell when
|
||||
|
Loading…
Reference in New Issue
Block a user