lnd+chanbackup: add lnd config flag

In this commit, we add the --no-backup-archive with a default
as false. When set to true then previous channel backup file will
not be archived but replaced. We also modify TestUpdateAndSwap
test to make sure the new behaviour works as expected.
This commit is contained in:
Abdullahi Yunus
2024-11-01 12:24:04 +01:00
parent a51dfe9a7d
commit 84f039db45
5 changed files with 119 additions and 18 deletions

View File

@@ -1648,7 +1648,9 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
chanNotifier: s.channelNotifier,
addrs: s.addrSource,
}
backupFile := chanbackup.NewMultiFile(cfg.BackupFilePath)
backupFile := chanbackup.NewMultiFile(
cfg.BackupFilePath, cfg.NoBackupArchive,
)
startingChans, err := chanbackup.FetchStaticChanBackups(
s.chanStateDB, s.addrSource,
)