cmd/lncli: properly parse channel backup within lncli create

This commit is contained in:
Wilmer Paulino 2019-05-21 15:16:44 -07:00
parent 339080394d
commit 92d780f157
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

@ -1588,23 +1588,27 @@ mnemonicCheck:
// We'll also check to see if they provided any static channel backups,
// if so, then we'll also tack these onto the final innit wallet
// request.
var chanBackups *lnrpc.ChanBackupSnapshot
backups, err := parseChanBackups(ctx)
if err != nil {
return fmt.Errorf("unable to parse chan "+
"backups: %v", err)
}
var chanBackups *lnrpc.ChanBackupSnapshot
if backups != nil {
switch {
case backups.GetChanBackups() != nil:
singleBackup := backups.GetChanBackups()
chanBackups.SingleChanBackups = singleBackup
chanBackups = &lnrpc.ChanBackupSnapshot{
SingleChanBackups: singleBackup,
}
case backups.GetMultiChanBackup() != nil:
multiBackup := backups.GetMultiChanBackup()
chanBackups.MultiChanBackup = &lnrpc.MultiChanBackup{
chanBackups = &lnrpc.ChanBackupSnapshot{
MultiChanBackup: &lnrpc.MultiChanBackup{
MultiChanBackup: multiBackup,
},
}
}
}