Fix race condition on DLC node startup wrt to tor (#4335)

This commit is contained in:
Chris Stewart 2022-05-13 09:56:53 -05:00 committed by GitHub
parent 63e8d76dfc
commit 272f31aeaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -178,9 +178,14 @@ class BitcoinSServerMain(override val serverArgParser: ServerArgParser)(implicit
}
val startedWalletF = configuredWalletF.flatMap(_.start())
val startedDLCNodeF = dlcNodeF
.flatMap(_.start())
.flatMap(_ => dlcNodeF)
val startedDLCNodeF = {
for {
dlcNode <- dlcNodeF
_ <- startedTorConfigF
_ <- dlcNode.start()
} yield dlcNode
}
val chainApi = ChainHandler.fromDatabase()
//start our http server now that we are synced