Remove dead code and re-order transit from pending to main hostmap on stage 2 (#828)

This commit is contained in:
Nate Brown
2023-03-17 15:36:24 -05:00
committed by GitHub
parent 61b784d2bb
commit f0ef80500d
2 changed files with 4 additions and 54 deletions

View File

@@ -384,8 +384,9 @@ func (c *HandshakeManager) Complete(hostinfo *HostInfo, f *Interface) *HostInfo
}
existingHostInfo := c.mainHostMap.Hosts[hostinfo.vpnIp]
c.mainHostMap.unlockedAddHostInfo(hostinfo, f)
// We need to remove from the pending hostmap first to avoid undoing work when after to the main hostmap.
c.pendingHostMap.unlockedDeleteHostInfo(hostinfo)
c.mainHostMap.unlockedAddHostInfo(hostinfo, f)
return existingHostInfo
}