mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
htlcswitch: prevent ChannelLink from leaking ChannelPoint pointer
This commit is contained in:
parent
db39a905cb
commit
16be46c1e5
@ -221,7 +221,7 @@ type ChannelLink interface {
|
||||
IsUnadvertised() bool
|
||||
|
||||
// ChannelPoint returns the channel outpoint for the channel link.
|
||||
ChannelPoint() *wire.OutPoint
|
||||
ChannelPoint() wire.OutPoint
|
||||
|
||||
// ShortChanID returns the short channel ID for the channel link. The
|
||||
// short channel ID encodes the exact location in the main chain that
|
||||
|
@ -1090,8 +1090,8 @@ func (l *channelLink) htlcManager() {
|
||||
// ActiveLinkEvent. We'll also defer an inactive link notification for
|
||||
// when the link exits to ensure that every active notification is
|
||||
// matched by an inactive one.
|
||||
l.cfg.NotifyActiveLink(*l.ChannelPoint())
|
||||
defer l.cfg.NotifyInactiveLinkEvent(*l.ChannelPoint())
|
||||
l.cfg.NotifyActiveLink(l.ChannelPoint())
|
||||
defer l.cfg.NotifyInactiveLinkEvent(l.ChannelPoint())
|
||||
|
||||
// TODO(roasbeef): need to call wipe chan whenever D/C?
|
||||
|
||||
@ -1215,8 +1215,8 @@ func (l *channelLink) htlcManager() {
|
||||
// we can go ahead and send the active channel notification. We'll also
|
||||
// defer the inactive notification for when the link exits to ensure
|
||||
// that every active notification is matched by an inactive one.
|
||||
l.cfg.NotifyActiveChannel(*l.ChannelPoint())
|
||||
defer l.cfg.NotifyInactiveChannel(*l.ChannelPoint())
|
||||
l.cfg.NotifyActiveChannel(l.ChannelPoint())
|
||||
defer l.cfg.NotifyInactiveChannel(l.ChannelPoint())
|
||||
|
||||
// With the channel states synced, we now reset the mailbox to ensure
|
||||
// we start processing all unacked packets in order. This is done here
|
||||
@ -2558,9 +2558,8 @@ func (l *channelLink) PeerPubKey() [33]byte {
|
||||
|
||||
// ChannelPoint returns the channel outpoint for the channel link.
|
||||
// NOTE: Part of the ChannelLink interface.
|
||||
func (l *channelLink) ChannelPoint() *wire.OutPoint {
|
||||
chanPoint := l.channel.ChannelPoint()
|
||||
return &chanPoint
|
||||
func (l *channelLink) ChannelPoint() wire.OutPoint {
|
||||
return l.channel.ChannelPoint()
|
||||
}
|
||||
|
||||
// ShortChanID returns the short channel ID for the channel link. The short
|
||||
|
@ -907,7 +907,10 @@ func (f *mockChannelLink) PeerPubKey() [33]byte {
|
||||
return f.peer.PubKey()
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) ChannelPoint() *wire.OutPoint { return &wire.OutPoint{} }
|
||||
func (f *mockChannelLink) ChannelPoint() wire.OutPoint {
|
||||
return wire.OutPoint{}
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) Stop() {}
|
||||
func (f *mockChannelLink) EligibleToForward() bool { return f.eligible }
|
||||
func (f *mockChannelLink) MayAddOutgoingHtlc(lnwire.MilliSatoshi) error { return nil }
|
||||
|
Loading…
Reference in New Issue
Block a user