chanbackup: extend channel backups to include entire local+remote chan config
In this commit, we extend the prior Single format to include the entire channel config, other than the constraints, but including the CSV delay for both sides. We do this as we'll need more of the keying information in order to properly execute the DLP protocol. Additionally, in the future, if warranted, this would allow channels to be resumed if deemed safe.
This commit is contained in:
3 files changed
+226
-40
No files matched your search
@@ -96,17 +96,17 @@ func (b *MultiFile) UpdateAndSwap(newBackup PackedMulti) error {
|
||||
var err error
|
||||
b.tempFile, err = os.Create(b.tempFileName)
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("unable to create temp file: %v", err)
|
||||
}
|
||||
|
||||
// With the file created, we'll write the new packed multi backup and
|
||||
// remove the temporary file all together once this method exits.
|
||||
_, err = b.tempFile.Write([]byte(newBackup))
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("unable to write backup to temp file: %v", err)
|
||||
}
|
||||
if err := b.tempFile.Sync(); err != nil {
|
||||
return err
|
||||
return fmt.Errorf("unable to sync temp file: %v", err)
|
||||
}
|
||||
defer os.Remove(b.tempFileName)
|
||||
|
||||
|
||||
Reference in new issue
Block a user