discovery: fix heap escape on cachedMsgs

This commit is contained in:
yyforyongyu committed 2023-02-23 23:18:05 +08:00
1 parent d793a53bba
commit ce1d1c6248
1 file changed
+3 -2
+3 -2
View File
@@ -1900,9 +1900,10 @@ func (d *AuthenticatedGossiper) isPremature(chanID lnwire.ShortChannelID,
pMsg := &processedNetworkMsg{msg: copied}
// Add the network message.
cachedMsgs.msgs = append(cachedMsgs.msgs, pMsg)
msgs := cachedMsgs.msgs
msgs = append(msgs, pMsg)
_, err = d.futureMsgs.Put(msgHeight, &cachedNetworkMsg{
msgs: cachedMsgs.msgs,
msgs: msgs,
})
if err != nil {
log.Errorf("Adding future message got error: %v", err)