This commit is contained in:
boufni95 2025-04-10 17:29:08 +00:00
parent cf9a10ded4
commit cdb742053b
2 changed files with 4 additions and 0 deletions

View file

@ -103,6 +103,7 @@ LSP_MAX_FEE_BPS=100
#METRICS_TOKEN= #METRICS_TOKEN=
# Disable outbound payments aka honeypot mode # Disable outbound payments aka honeypot mode
#DISABLE_EXTERNAL_PAYMENTS=false #DISABLE_EXTERNAL_PAYMENTS=false
#ALLOW_RESET_METRICS_STORAGES=false
#WATCHDOG SECURITY #WATCHDOG SECURITY
# A last line of defense against 0-day drainage attacks # A last line of defense against 0-day drainage attacks

View file

@ -35,6 +35,9 @@ export class TlvFilesStorage {
} }
Reset = () => { Reset = () => {
if (this.storagePath === "" && this.storagePath.startsWith("/")) {
throw new Error("cannot delete root storage path")
}
clearInterval(this.interval) clearInterval(this.interval)
fs.rmSync(this.storagePath, { recursive: true, force: true }) fs.rmSync(this.storagePath, { recursive: true, force: true })
this.init() this.init()