Skip to content

Commit

Permalink
fix: don't process loop creds if not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
openoms committed Oct 27, 2022
1 parent 6b97656 commit 653cf88
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/config/process.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ConfigError } from "./error"
import { getCronConfig} from "@config"

type TwilioConfig = {
accountSid: string
Expand Down Expand Up @@ -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)
Expand All @@ -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) {
Expand Down

0 comments on commit 653cf88

Please sign in to comment.