mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01:00
chanbackup: disable channel backup for anchor types
This commit is contained in:
parent
fd93c568ea
commit
7adb1bcbaa
@ -62,6 +62,12 @@ func FetchBackupForChan(chanPoint wire.OutPoint,
|
||||
return nil, fmt.Errorf("unable to find target channel")
|
||||
}
|
||||
|
||||
// TODO(halseth): support chan backups for anchor types.
|
||||
if targetChan.ChanType.HasAnchors() {
|
||||
return nil, fmt.Errorf("channel type does not support " +
|
||||
"backups yet")
|
||||
}
|
||||
|
||||
// Once we have the target channel, we can assemble the backup using
|
||||
// the source to obtain any extra information that we may need.
|
||||
staticChanBackup, err := assembleChanBackup(chanSource, targetChan)
|
||||
@ -85,14 +91,19 @@ func FetchStaticChanBackups(chanSource LiveChannelSource) ([]Single, error) {
|
||||
// Now that we have all the channels, we'll use the chanSource to
|
||||
// obtain any auxiliary information we need to craft a backup for each
|
||||
// channel.
|
||||
staticChanBackups := make([]Single, len(openChans))
|
||||
for i, openChan := range openChans {
|
||||
staticChanBackups := make([]Single, 0, len(openChans))
|
||||
for _, openChan := range openChans {
|
||||
// TODO(halseth): support chan backups for anchor types.
|
||||
if openChan.ChanType.HasAnchors() {
|
||||
continue
|
||||
}
|
||||
|
||||
chanBackup, err := assembleChanBackup(chanSource, openChan)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
staticChanBackups[i] = *chanBackup
|
||||
staticChanBackups = append(staticChanBackups, *chanBackup)
|
||||
}
|
||||
|
||||
return staticChanBackups, nil
|
||||
|
@ -213,6 +213,12 @@ func (s *SubSwapper) backupUpdater() {
|
||||
// For all new open channels, we'll create a new SCB
|
||||
// given the required information.
|
||||
for _, newChan := range chanUpdate.NewChans {
|
||||
// TODO(halseth): support chan backups for
|
||||
// anchor types.
|
||||
if newChan.ChanType.HasAnchors() {
|
||||
continue
|
||||
}
|
||||
|
||||
log.Debugf("Adding channel %v to backup state",
|
||||
newChan.FundingOutpoint)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user