mirror of
https://github.com/ACINQ/eclair.git
synced 2025-02-23 06:35:11 +01:00
refusing to boot if bitcoind's sync progress is <= 0.99
This commit is contained in:
parent
1e10074f27
commit
8122b58229
1 changed files with 3 additions and 3 deletions
|
@ -58,10 +58,10 @@ class Setup() extends Logging {
|
||||||
|
|
||||||
implicit val formats = org.json4s.DefaultFormats
|
implicit val formats = org.json4s.DefaultFormats
|
||||||
implicit val ec = ExecutionContext.Implicits.global
|
implicit val ec = ExecutionContext.Implicits.global
|
||||||
// TODO: check if bitcoind is in sync
|
val (chain, blockCount, progress) = Await.result(bitcoin_client.client.invoke("getblockchaininfo").map(json => ((json \ "chain").extract[String], (json \ "blocks").extract[Long], (json \ "verificationprogress").extract[Double])), 10 seconds)
|
||||||
val (chain, blockCount) = Await.result(bitcoin_client.client.invoke("getblockchaininfo").map(json => ((json \ "chain").extract[String], (json \ "blocks").extract[Long])), 10 seconds)
|
|
||||||
Globals.blockCount.set(blockCount)
|
|
||||||
assert(chain == "testnet" || chain == "regtest" || chain == "segnet4", "you should be on testnet or regtest or segnet4")
|
assert(chain == "testnet" || chain == "regtest" || chain == "segnet4", "you should be on testnet or regtest or segnet4")
|
||||||
|
assert(progress > 0.99, "bitcoind should be synchronized")
|
||||||
|
Globals.blockCount.set(blockCount)
|
||||||
val bitcoinVersion = Await.result(bitcoin_client.client.invoke("getinfo").map(json => (json \ "version").extract[String]), 10 seconds)
|
val bitcoinVersion = Await.result(bitcoin_client.client.invoke("getinfo").map(json => (json \ "version").extract[String]), 10 seconds)
|
||||||
// we use it as final payment address, so that funds are moved to the bitcoind wallet upon channel termination
|
// we use it as final payment address, so that funds are moved to the bitcoind wallet upon channel termination
|
||||||
val JString(finalAddress) = Await.result(bitcoin_client.client.invoke("getnewaddress"), 10 seconds)
|
val JString(finalAddress) = Await.result(bitcoin_client.client.invoke("getnewaddress"), 10 seconds)
|
||||||
|
|
Loading…
Add table
Reference in a new issue