This commit is contained in:
boufni95 2024-03-26 18:53:28 +01:00
parent b1dcf946b2
commit 34cebc800e
2 changed files with 6 additions and 4 deletions

View file

@ -44,5 +44,9 @@ MIGRATE_DB=false
RECORD_PERFORMANCE=true
SKIP_SANITY_CHECK=false
DISABLE_EXTERNAL_PAYMENTS=false
WATCHDOG_MAX_DIFF_BPS=100
# Max difference between users balance and LND balance since beginning of app execution
WATCHDOG_MAX_DIFF_SATS=10000
# Max difference between users balance and LND balance after each payment
WATCHDOG_MAX_UPDATE_DIFF_SATS=1000

View file

@ -2,13 +2,11 @@ import { EnvMustBeInteger } from "../helpers/envParser.js";
import { getLogger } from "../helpers/logger.js";
import { LightningHandler } from "./index.js";
export type WatchdogSettings = {
maxDiffBps: number
maxDiffSats: number
maxUpdateDiffSats: number
}
export const LoadWatchdogSettingsFromEnv = (test = false): WatchdogSettings => {
return {
maxDiffBps: EnvMustBeInteger("WATCHDOG_MAX_DIFF_BPS"),
maxDiffSats: EnvMustBeInteger("WATCHDOG_MAX_DIFF_SATS"),
maxUpdateDiffSats: EnvMustBeInteger("WATCHDOG_MAX_UPDATE_DIFF_SATS")
}