Skip to content

Commit

Permalink
Check for bitcoind's getrawtransaction availablilty during startup
Browse files Browse the repository at this point in the history
  • Loading branch information
araspitzu committed Sep 17, 2019
1 parent 4c387bb commit 87f812d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions eclair-core/src/main/scala/fr/acinq/eclair/Setup.scala
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ class Setup(datadir: File,
.filter(value => (value \ "spendable").extract[Boolean])
.map(value => (value \ "address").extract[String])
}
_ <- chain match {
case "mainnet" => bitcoinClient.invoke("getrawtransaction", "2157b554dcfda405233906e461ee593875ae4b1b97615872db6a25130ecc1dd6") // coinbase of #500000
case "testnet" => bitcoinClient.invoke("getrawtransaction", "8f38a0dd41dc0ae7509081e262d791f8d53ed6f884323796d5ec7b0966dd3825") // coinbase of #1500000
case "regtest" => Future.successful(())
}
} yield (progress, ibd, chainHash, bitcoinVersion, unspentAddresses, blocks, headers)
// blocking sanity checks
val (progress, initialBlockDownload, chainHash, bitcoinVersion, unspentAddresses, blocks, headers) = await(future, 30 seconds, "bicoind did not respond after 30 seconds")
Expand Down

0 comments on commit 87f812d

Please sign in to comment.