From 653cf8843041dfc0841c81ad511caea1c8492966 Mon Sep 17 00:00:00 2001 From: openoms Date: Wed, 26 Oct 2022 11:49:41 +0100 Subject: [PATCH] fix: don't process loop creds if not enabled --- src/config/process.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config/process.ts b/src/config/process.ts index dc9e430ae8..6689292b0b 100644 --- a/src/config/process.ts +++ b/src/config/process.ts @@ -1,4 +1,5 @@ import { ConfigError } from "./error" +import { getCronConfig} from "@config" type TwilioConfig = { accountSid: string @@ -102,7 +103,7 @@ export const LND_HEALTH_REFRESH_TIME_MS = parseInt( 10, ) -export const getLoopConfig = () => { +export const getLoopConfig = getCronConfig().swapEnabled ? () => { if (!process.env.LND1_LOOP_TLS) throw new ConfigError("Missing LND1_LOOP_TLS config") if (!process.env.LND2_LOOP_TLS) throw new ConfigError("Missing LND2_LOOP_TLS config") if (!process.env.LND1_LOOP_MACAROON) @@ -115,7 +116,7 @@ export const getLoopConfig = () => { lnd2LoopTls: process.env.LND2_LOOP_TLS, lnd2LoopMacaroon: process.env.LND2_LOOP_MACAROON as Macaroon, } -} +} : null export const getKratosMasterPhonePassword = () => { if (!process.env.KRATOS_MASTER_PHONE_PASSWORD) {