cmd/lncli: properly parse channel backup within lncli create
This commit is contained in:
parent
339080394d
commit
92d780f157
@ -1588,23 +1588,27 @@ mnemonicCheck:
|
|||||||
// We'll also check to see if they provided any static channel backups,
|
// 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
|
// if so, then we'll also tack these onto the final innit wallet
|
||||||
// request.
|
// request.
|
||||||
var chanBackups *lnrpc.ChanBackupSnapshot
|
|
||||||
backups, err := parseChanBackups(ctx)
|
backups, err := parseChanBackups(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to parse chan "+
|
return fmt.Errorf("unable to parse chan "+
|
||||||
"backups: %v", err)
|
"backups: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var chanBackups *lnrpc.ChanBackupSnapshot
|
||||||
if backups != nil {
|
if backups != nil {
|
||||||
switch {
|
switch {
|
||||||
case backups.GetChanBackups() != nil:
|
case backups.GetChanBackups() != nil:
|
||||||
singleBackup := backups.GetChanBackups()
|
singleBackup := backups.GetChanBackups()
|
||||||
chanBackups.SingleChanBackups = singleBackup
|
chanBackups = &lnrpc.ChanBackupSnapshot{
|
||||||
|
SingleChanBackups: singleBackup,
|
||||||
|
}
|
||||||
|
|
||||||
case backups.GetMultiChanBackup() != nil:
|
case backups.GetMultiChanBackup() != nil:
|
||||||
multiBackup := backups.GetMultiChanBackup()
|
multiBackup := backups.GetMultiChanBackup()
|
||||||
chanBackups.MultiChanBackup = &lnrpc.MultiChanBackup{
|
chanBackups = &lnrpc.ChanBackupSnapshot{
|
||||||
|
MultiChanBackup: &lnrpc.MultiChanBackup{
|
||||||
MultiChanBackup: multiBackup,
|
MultiChanBackup: multiBackup,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user