pyln: Set the bitcoin datadir when running tests

Telling `lightningd` to pass a `-datadir` to `bitcoin-cli` so it doesn't go
snooping where it doesn't belong (i.e., the user's home directory and config).

Changelog-None
Suggested-by: Simon Vrouwe <@SimonVrouwe>
Signed-off-by: Christian Decker <@cdecker>
This commit is contained in:
Christian Decker 2020-04-28 19:21:39 +02:00 committed by Rusty Russell
parent 9bfdf234f3
commit 7b752e00d5
2 changed files with 4 additions and 0 deletions

View file

@ -489,6 +489,9 @@ class LightningD(TailableProc):
'ignore-fee-limits': 'false',
'bitcoin-rpcuser': BITCOIND_CONFIG['rpcuser'],
'bitcoin-rpcpassword': BITCOIND_CONFIG['rpcpassword'],
# Make sure we don't touch any existing config files in the user's $HOME
'bitcoin-datadir': lightning_dir,
}
for k, v in opts.items():

View file

@ -33,5 +33,6 @@ def getchaininfo(plugin, **kwargs):
plugin.add_option("bitcoin-rpcuser", "", "")
plugin.add_option("bitcoin-rpcpassword", "", "")
plugin.add_option("bitcoin-rpcport", "", "")
plugin.add_option("bitcoin-datadir", "", "")
plugin.run()