mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-12-28 17:44:47 +01:00
7b752e00d5
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>
39 lines
808 B
Python
Executable File
39 lines
808 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
This registers part of the Bitcoin backend methods.
|
|
We only use it for testing startup and we don't care about the actual values.
|
|
"""
|
|
import time
|
|
|
|
from pyln.client import Plugin
|
|
|
|
|
|
plugin = Plugin()
|
|
|
|
|
|
@plugin.method("estimatefees")
|
|
def getfeerate(plugin, **kwargs):
|
|
time.sleep(1)
|
|
return {}
|
|
|
|
|
|
@plugin.method("getrawblockbyheight")
|
|
def getblock(plugin, **kwargs):
|
|
time.sleep(1)
|
|
return {}
|
|
|
|
|
|
@plugin.method("getchaininfo")
|
|
def getchaininfo(plugin, **kwargs):
|
|
time.sleep(1)
|
|
return {}
|
|
|
|
|
|
# We don't use these options, but it allows us to get to the expected failure.
|
|
plugin.add_option("bitcoin-rpcuser", "", "")
|
|
plugin.add_option("bitcoin-rpcpassword", "", "")
|
|
plugin.add_option("bitcoin-rpcport", "", "")
|
|
plugin.add_option("bitcoin-datadir", "", "")
|
|
|
|
plugin.run()
|