mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-28 21:53:41 +02:00
Merge pull request #7445 from yyforyongyu/fix-heap
discovery: fix heap escape on `cachedMsgs`
This commit is contained in:
@@ -1905,9 +1905,10 @@ func (d *AuthenticatedGossiper) isPremature(chanID lnwire.ShortChannelID,
|
|||||||
pMsg := &processedNetworkMsg{msg: copied}
|
pMsg := &processedNetworkMsg{msg: copied}
|
||||||
|
|
||||||
// Add the network message.
|
// Add the network message.
|
||||||
cachedMsgs.msgs = append(cachedMsgs.msgs, pMsg)
|
msgs := cachedMsgs.msgs
|
||||||
|
msgs = append(msgs, pMsg)
|
||||||
_, err = d.futureMsgs.Put(msgHeight, &cachedNetworkMsg{
|
_, err = d.futureMsgs.Put(msgHeight, &cachedNetworkMsg{
|
||||||
msgs: cachedMsgs.msgs,
|
msgs: msgs,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("Adding future message got error: %v", err)
|
log.Errorf("Adding future message got error: %v", err)
|
||||||
|
Reference in New Issue
Block a user