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
2021-08-03 14:59:15 -04:00
parent 6c6e353597
commit 051cd8793a
6 changed files with 43 additions and 37 deletions

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