htlcswitch: introduce and embed packetHandler interface in ChannelLink

This will allow separating the now-private *htlcPacket methods from
the publicly-used ChannelLink interface methods.
This commit is contained in:
eugene committed 2021-08-10 17:15:51 -04:00
1 parent 6c6e353597
commit 051cd8793a
6 files changed
+43 -37

No files matched your search

+2 -2
View File
@@ -509,7 +509,7 @@ func (s *Switch) SendHTLC(firstHop lnwire.ShortChannelID, attemptID uint64,
return linkErr
}
return link.HandleLocalAddPacket(packet)
return link.handleLocalAddPacket(packet)
}
// UpdateForwardingPolicies sends a message to the switch to update the
@@ -1101,7 +1101,7 @@ func (s *Switch) handlePacketForward(packet *htlcPacket) error {
// Send the packet to the destination channel link which
// manages the channel.
packet.outgoingChanID = destination.ShortChanID()
return destination.HandleSwitchPacket(packet)
return destination.handleSwitchPacket(packet)
case *lnwire.UpdateFailHTLC, *lnwire.UpdateFulfillHTLC:
// If the source of this packet has not been set, use the