utxonursery+chanbackup: fix range loop binding bugs

This commit is contained in:
Conner Fromknecht committed 2019-05-16 20:37:30 -07:00
1 parent 27ae22fa6c
commit 17ab813dcf
3 files changed
+10 -8

No files matched your search

+2 -2
View File
@@ -230,10 +230,10 @@ func (s *SubSwapper) backupUpdater() {
// For all closed channels, we'll remove the prior
// backup state.
for _, closedChan := range chanUpdate.ClosedChans {
for i, closedChan := range chanUpdate.ClosedChans {
log.Debugf("Removing channel %v from backup "+
"state", newLogClosure(func() string {
return closedChan.String()
return chanUpdate.ClosedChans[i].String()
}))
delete(s.backupState, closedChan)
+2 -2
View File
@@ -42,7 +42,7 @@ type PeerConnector interface {
func Recover(backups []Single, restorer ChannelRestorer,
peerConnector PeerConnector) error {
for _, backup := range backups {
for i, backup := range backups {
log.Infof("Restoring ChannelPoint(%v) to disk: ",
backup.FundingOutpoint)
@@ -55,7 +55,7 @@ func Recover(backups []Single, restorer ChannelRestorer,
"restore ChannelPoint(%v)",
backup.RemoteNodePub.SerializeCompressed(),
newLogClosure(func() string {
return spew.Sdump(backup.Addresses)
return spew.Sdump(backups[i].Addresses)
}), backup.FundingOutpoint)
err = peerConnector.ConnectPeer(