Skip to content

Commit

Permalink
specify ln_backend_needed as needed
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamISZ committed Jan 18, 2022
1 parent a9f22bb commit 5e92bb1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions jmclient/jmclient/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,9 @@ def load_program_config(config_path="", bs=None, plugin_services=[],
lnchans = [x for x in chans if "type" in x and x["type"] == "ln-onion"]
# only 1; multiple directories will be in this config section:
assert len(lnchans) < 2
# The additional flag 'ln_backend_needed' exists to address
# the case of a user with Lightning configured, but doing a non-interactive
# operation; in this case, starting the Lightning backend is pointless.
if lnchans and ln_backend_needed:
lnchanconfig = lnchans[0]
if lnchanconfig["clightning-location"] == "bundled":
Expand Down
2 changes: 1 addition & 1 deletion scripts/joinmarket-qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2343,7 +2343,7 @@ def get_wallet_printout(wallet_service):

config_load_error = False
try:
load_program_config(config_path=options.datadir)
load_program_config(config_path=options.datadir, ln_backend_needed=True)
except Exception as e:
config_load_error = "Failed to setup joinmarket: "+repr(e)
if "RPC" in repr(e):
Expand Down
2 changes: 1 addition & 1 deletion scripts/tumbler.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def main():
if len(args) < 1:
jmprint('Error: Needs a wallet file', "error")
sys.exit(EXIT_ARGERROR)
load_program_config(config_path=options['datadir'])
load_program_config(config_path=options['datadir'], ln_backend_needed=True)
logsdir = os.path.join(os.path.dirname(
jm_single().config_location), "logs")
tumble_log = get_tumble_log(logsdir)
Expand Down
2 changes: 1 addition & 1 deletion test/ygrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def get_addr_and_fund(yg):

@pytest.fixture(scope="module")
def setup_ygrunner():
load_test_config()
load_test_config(ln_backend_needed=True)
jm_single().bc_interface.tick_forward_chain_interval = 10
jm_single().bc_interface.simulate_blocks()
# handles the custom regtest hrp for bech32
Expand Down

0 comments on commit 5e92bb1

Please sign in to comment.