Skip to content

Commit

Permalink
chanbackup: continue recovery if channel already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Nov 18, 2019
1 parent 88f037f commit 7ddfc62
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion chanbackup/recover.go
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/btcsuite/btcd/btcec"
"github.com/davecgh/go-spew/spew"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/keychain"
)

Expand Down Expand Up @@ -47,7 +48,15 @@ func Recover(backups []Single, restorer ChannelRestorer,
backup.FundingOutpoint)

err := restorer.RestoreChansFromSingles(backup)
if err != nil {
switch err {
// If a channel is already present in the channel DB, we can
// just continue. No reason to fail a whole set of multi backups
// for example. This allows resume of a restore in case another
// error happens.
case channeldb.ErrChanAlreadyExists:
continue

case nil:
return err
}

Expand Down

0 comments on commit 7ddfc62

Please sign in to comment.