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 committed 2025-01-24 10:56:15 +01:00
1 parent a51dfe9a7d
commit 84f039db45
5 files changed
+119 -18

No files matched your search

+3 -1
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,
)