@@ -92,13 +92,6 @@ type ChannelLinkConfig struct {
9292 // allowing the link to open and close circuits.
9393 Circuits CircuitModifier
9494
95- // Switch provides a reference to the HTLC switch, we only use this in
96- // testing to access circuit operations not typically exposed by the
97- // CircuitModifier.
98- //
99- // TODO(conner): remove after refactoring htlcswitch testing framework.
100- Switch * Switch
101-
10295 // BestHeight returns the best known height.
10396 BestHeight func () uint32
10497
@@ -320,9 +313,6 @@ type channelLink struct {
320313 // updates.
321314 channel * lnwallet.LightningChannel
322315
323- // shortChanID is the most up to date short channel ID for the link.
324- shortChanID lnwire.ShortChannelID
325-
326316 // cfg is a structure which carries all dependable fields/handlers
327317 // which may affect behaviour of the service.
328318 cfg ChannelLinkConfig
@@ -455,7 +445,6 @@ func NewChannelLink(cfg ChannelLinkConfig,
455445 return & channelLink {
456446 cfg : cfg ,
457447 channel : channel ,
458- shortChanID : channel .ShortChanID (),
459448 hodlMap : make (map [models.CircuitKey ]hodlHtlc ),
460449 hodlQueue : queue .NewConcurrentQueue (10 ),
461450 log : build .NewPrefixLog (logPrefix , log ),
@@ -2202,7 +2191,7 @@ func (l *channelLink) handleUpstreamMsg(msg lnwire.Message) {
22022191 for id , settled := range finalHTLCs {
22032192 l .cfg .HtlcNotifier .NotifyFinalHtlcEvent (
22042193 models.CircuitKey {
2205- ChanID : l .shortChanID ,
2194+ ChanID : l .ShortChanID () ,
22062195 HtlcID : id ,
22072196 },
22082197 channeldb.FinalHtlcInfo {
@@ -2563,8 +2552,8 @@ func (l *channelLink) updateCommitTx() error {
25632552// channel link opened.
25642553//
25652554// NOTE: Part of the ChannelLink interface.
2566- func (l * channelLink ) Peer () lnpeer. Peer {
2567- return l .cfg .Peer
2555+ func (l * channelLink ) PeerPubKey () [ 33 ] byte {
2556+ return l .cfg .Peer . PubKey ()
25682557}
25692558
25702559// ChannelPoint returns the channel outpoint for the channel link.
@@ -2582,7 +2571,7 @@ func (l *channelLink) ShortChanID() lnwire.ShortChannelID {
25822571 l .RLock ()
25832572 defer l .RUnlock ()
25842573
2585- return l .shortChanID
2574+ return l .channel . ShortChanID ()
25862575}
25872576
25882577// UpdateShortChanID updates the short channel ID for a link. This may be
0 commit comments