mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 07:35:07 +02:00
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:
@@ -891,10 +891,22 @@ func (f *mockChannelLink) Start() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) ChanID() lnwire.ChannelID { return f.chanID }
|
||||
func (f *mockChannelLink) ShortChanID() lnwire.ShortChannelID { return f.shortChanID }
|
||||
func (f *mockChannelLink) Bandwidth() lnwire.MilliSatoshi { return 99999999 }
|
||||
func (f *mockChannelLink) Peer() lnpeer.Peer { return f.peer }
|
||||
func (f *mockChannelLink) ChanID() lnwire.ChannelID {
|
||||
return f.chanID
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) ShortChanID() lnwire.ShortChannelID {
|
||||
return f.shortChanID
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) Bandwidth() lnwire.MilliSatoshi {
|
||||
return 99999999
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) PeerPubKey() [33]byte {
|
||||
return f.peer.PubKey()
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) ChannelPoint() *wire.OutPoint { return &wire.OutPoint{} }
|
||||
func (f *mockChannelLink) Stop() {}
|
||||
func (f *mockChannelLink) EligibleToForward() bool { return f.eligible }
|
||||
|
Reference in New Issue
Block a user