htlcswitch: avoid leaking peer interface from link

Here we notice that the only use of the Peer call on the link is
to find out what the peer's pubkey is. To avoid leaking handles to
IO actions outside the interface we reduce the surface area to
just return the peer's public key.
This commit is contained in:
Keagan McClelland committed 2024-03-06 11:59:09 -08:00
1 parent be69b022d9
commit 3761912680
4 files changed
+26 -15

No files matched your search

+2 -2
View File
@@ -2552,8 +2552,8 @@ func (l *channelLink) updateCommitTx() error {
// channel link opened.
//
// NOTE: Part of the ChannelLink interface.
func (l *channelLink) Peer() lnpeer.Peer {
return l.cfg.Peer
func (l *channelLink) PeerPubKey() [33]byte {
return l.cfg.Peer.PubKey()
}
// ChannelPoint returns the channel outpoint for the channel link.