htlcswitch: remove redundant field from channelLink

This commit is contained in:
Keagan McClelland committed 2024-02-27 17:06:35 -08:00
1 parent 72764b1473
commit 38db17b8cc
2 files changed
+2 -7

No files matched your search

+2 -6
View File
@@ -320,9 +320,6 @@ type channelLink struct {
// updates.
channel *lnwallet.LightningChannel
// shortChanID is the most up to date short channel ID for the link.
shortChanID lnwire.ShortChannelID
// cfg is a structure which carries all dependable fields/handlers
// which may affect behaviour of the service.
cfg ChannelLinkConfig
@@ -455,7 +452,6 @@ func NewChannelLink(cfg ChannelLinkConfig,
return &channelLink{
cfg: cfg,
channel: channel,
shortChanID: channel.ShortChanID(),
hodlMap: make(map[models.CircuitKey]hodlHtlc),
hodlQueue: queue.NewConcurrentQueue(10),
log: build.NewPrefixLog(logPrefix, log),
@@ -2202,7 +2198,7 @@ func (l *channelLink) handleUpstreamMsg(msg lnwire.Message) {
for id, settled := range finalHTLCs {
l.cfg.HtlcNotifier.NotifyFinalHtlcEvent(
models.CircuitKey{
ChanID: l.shortChanID,
ChanID: l.ShortChanID(),
HtlcID: id,
},
channeldb.FinalHtlcInfo{
@@ -2582,7 +2578,7 @@ func (l *channelLink) ShortChanID() lnwire.ShortChannelID {
l.RLock()
defer l.RUnlock()
return l.shortChanID
return l.channel.ShortChanID()
}
// UpdateShortChanID updates the short channel ID for a link. This may be
-1
View File
@@ -5313,7 +5313,6 @@ func testSwitchHandlePacketForward(t *testing.T, zeroConf, private,
if zeroConf {
// Store the alias in the shortChanID field and mark the real
// scid in the database.
aliceChannelLink.shortChanID = aliceAlias
err = aliceChannelState.MarkRealScid(aliceScid)
require.NoError(t, err)