Merge pull request #8425 from ProofOfKeags/refactor/lnwallet/chan-point-leaks

[EZ Review]: avoid leaking pointers to authoritative ChannelPoint
This commit is contained in:
Oliver Gugger authored and GitHub committed 2024-03-11 00:55:41 -06:00
commit 5cb4811e86
31 files changed
+160 -149

No files matched your search

+2 -2
View File
@@ -621,7 +621,7 @@ func (s *Switch) UpdateForwardingPolicies(
// Update each link in chanPolicies.
for targetLink, policy := range chanPolicies {
cid := lnwire.NewChanIDFromOutPoint(&targetLink)
cid := lnwire.NewChanIDFromOutPoint(targetLink)
link, ok := s.linkIndex[cid]
if !ok {
@@ -1797,7 +1797,7 @@ out:
// relevant link (if it exists) so the channel can be
// cooperatively closed (if possible).
case req := <-s.chanCloseRequests:
chanID := lnwire.NewChanIDFromOutPoint(req.ChanPoint)
chanID := lnwire.NewChanIDFromOutPoint(*req.ChanPoint)
s.indexMtx.RLock()
link, ok := s.linkIndex[chanID]