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
|
// know what network it is on now
|
||||||
Future.successful(ConfigFactory.empty())
|
Future.successful(ConfigFactory.empty())
|
||||||
case BitcoindBackend =>
|
case BitcoindBackend =>
|
||||||
tmpConf.bitcoindRpcConf.client.getBlockChainInfo.map { info =>
|
if (!appConfig.torConf.enabled) {
|
||||||
val networkStr =
|
tmpConf.bitcoindRpcConf.client.getBlockChainInfo.map { info =>
|
||||||
DatadirUtil.networkStrToDirName(info.chain.name)
|
val networkStr =
|
||||||
ConfigFactory.parseString(s"bitcoin-s.network = $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 =>
|
netConfF.map { netConf =>
|
||||||
@ -82,7 +90,6 @@ class LandingPaneModel(serverArgParser: ServerArgParser)(implicit
|
|||||||
GlobalData.setBitcoinNetwork(
|
GlobalData.setBitcoinNetwork(
|
||||||
finalAppConfig.network,
|
finalAppConfig.network,
|
||||||
finalAppConfig.socks5ProxyParams.isDefined)
|
finalAppConfig.socks5ProxyParams.isDefined)
|
||||||
|
|
||||||
new BitcoinSServerMain(serverArgParser)(system, finalAppConfig)
|
new BitcoinSServerMain(serverArgParser)(system, finalAppConfig)
|
||||||
.run()
|
.run()
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ class BitcoinSServerMain(override val serverArgParser: ServerArgParser)(implicit
|
|||||||
implicit lazy val torConf: TorAppConfig = conf.torConf
|
implicit lazy val torConf: TorAppConfig = conf.torConf
|
||||||
|
|
||||||
override def start(): Future[Unit] = {
|
override def start(): Future[Unit] = {
|
||||||
|
logger.info("Starting appServer")
|
||||||
val startedConfigF = conf.start()
|
val startedConfigF = conf.start()
|
||||||
|
|
||||||
logger.info(s"Start on network ${walletConf.network}")
|
logger.info(s"Start on network ${walletConf.network}")
|
||||||
|
@ -41,6 +41,7 @@ case class TorAppConfig(
|
|||||||
override def start(): Future[Unit] = {
|
override def start(): Future[Unit] = {
|
||||||
lazy val torRunning = checkIfTorAlreadyRunning
|
lazy val torRunning = checkIfTorAlreadyRunning
|
||||||
if (enabled && !isStarted.get && !torRunning) {
|
if (enabled && !isStarted.get && !torRunning) {
|
||||||
|
logger.info(s"Starting tor")
|
||||||
isStarted.set(true)
|
isStarted.set(true)
|
||||||
val start = System.currentTimeMillis()
|
val start = System.currentTimeMillis()
|
||||||
//remove old tor log file so we accurately tell when
|
//remove old tor log file so we accurately tell when
|
||||||
|
Loading…
Reference in New Issue
Block a user