mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 00:24:19 +01:00
Terminate BitcoinD if, for some reason, it doesn't start properly. This cleans up the environment for future test runs.
This commit is contained in:
committed by
Christian Decker
parent
0cef23d33a
commit
71581ff96e
@@ -38,7 +38,13 @@ def to_json(arg):
|
|||||||
def setupBitcoind(directory):
|
def setupBitcoind(directory):
|
||||||
global bitcoind
|
global bitcoind
|
||||||
bitcoind = utils.BitcoinD(bitcoin_dir=directory, rpcport=28332)
|
bitcoind = utils.BitcoinD(bitcoin_dir=directory, rpcport=28332)
|
||||||
bitcoind.start()
|
|
||||||
|
try:
|
||||||
|
bitcoind.start()
|
||||||
|
except:
|
||||||
|
tearDownBitcoind()
|
||||||
|
raise
|
||||||
|
|
||||||
info = bitcoind.rpc.getblockchaininfo()
|
info = bitcoind.rpc.getblockchaininfo()
|
||||||
# Make sure we have segwit and some funds
|
# Make sure we have segwit and some funds
|
||||||
if info['blocks'] < 432:
|
if info['blocks'] < 432:
|
||||||
|
|||||||
Reference in New Issue
Block a user