Skip to content

Commit

Permalink
fix: return empty loop values on signet
Browse files Browse the repository at this point in the history
  • Loading branch information
openoms committed Oct 3, 2022
1 parent b4c6694 commit 3af61d6
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions src/config/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,26 @@ export const LND_HEALTH_REFRESH_TIME_MS = parseInt(
)

export const getLoopConfig = () => {
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)
throw new ConfigError("Missing LND1_LOOP_MACAROON config")
if (!process.env.LND2_LOOP_MACAROON)
throw new ConfigError("Missing LND2_LOOP_MACAROON config")
return {
lnd1LoopTls: process.env.LND1_LOOP_TLS,
lnd1LoopMacaroon: process.env.LND1_LOOP_MACAROON as Macaroon,
lnd2LoopTls: process.env.LND2_LOOP_TLS,
lnd2LoopMacaroon: process.env.LND2_LOOP_MACAROON as Macaroon,
if (process.env.NETWORK != "signet") {
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)
throw new ConfigError("Missing LND1_LOOP_MACAROON config")
if (!process.env.LND2_LOOP_MACAROON)
throw new ConfigError("Missing LND2_LOOP_MACAROON config")
return {
lnd1LoopTls: process.env.LND1_LOOP_TLS,
lnd1LoopMacaroon: process.env.LND1_LOOP_MACAROON as Macaroon,
lnd2LoopTls: process.env.LND2_LOOP_TLS,
lnd2LoopMacaroon: process.env.LND2_LOOP_MACAROON as Macaroon,
}
}
else {
return {
lnd1LoopTls: "",
lnd1LoopMacaroon: "" as Macaroon,
lnd2LoopTls: "",
lnd2LoopMacaroon: "" as Macaroon,
}
}
}

0 comments on commit 3af61d6

Please sign in to comment.