From aac8a2a7287c2ef99c5e1f0a80275d68e2d907d1 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 7 Jan 2020 09:50:16 +0100 Subject: [PATCH] Fix loop assignment issue --- cmd/chantools/fixoldbackup.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/chantools/fixoldbackup.go b/cmd/chantools/fixoldbackup.go index 4d24a19..490d190 100644 --- a/cmd/chantools/fixoldbackup.go +++ b/cmd/chantools/fixoldbackup.go @@ -58,7 +58,7 @@ func fixOldChannelBackup(multiFile *chanbackup.MultiFile, log.Infof("Checking shachain root of %d channels, this might take a "+ "while.", len(multi.StaticBackups)) fixedChannels := 0 - for _, single := range multi.StaticBackups { + for idx, single := range multi.StaticBackups { err := ring.CheckDescriptor(single.ShaChainRootDesc) switch err { case nil: @@ -77,7 +77,7 @@ func fixOldChannelBackup(multiFile *chanbackup.MultiFile, if err != nil { return err } - single.ShaChainRootDesc = baseKeyDesc + multi.StaticBackups[idx].ShaChainRootDesc = baseKeyDesc fixedChannels++ default: