mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-11 06:37:21 +01:00
htlcswitch/hop: move hop.Exit and hop.Source to hop pkg
This commit is contained in:
@@ -437,8 +437,8 @@ func (l *channelLink) Start() error {
|
||||
// off point, since all indexes below that are committed. This action
|
||||
// is only performed if the link's final short channel ID has been
|
||||
// assigned, otherwise we would try to trim the htlcs belonging to the
|
||||
// all-zero, sourceHop ID.
|
||||
if l.ShortChanID() != sourceHop {
|
||||
// all-zero, hop.Source ID.
|
||||
if l.ShortChanID() != hop.Source {
|
||||
localHtlcIndex, err := l.channel.NextLocalHtlcIndex()
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to retrieve next local "+
|
||||
@@ -536,7 +536,7 @@ func (l *channelLink) WaitForShutdown() {
|
||||
// the all-zero source ID, meaning that the channel has had its ID finalized.
|
||||
func (l *channelLink) EligibleToForward() bool {
|
||||
return l.channel.RemoteNextRevocation() != nil &&
|
||||
l.ShortChanID() != sourceHop
|
||||
l.ShortChanID() != hop.Source
|
||||
}
|
||||
|
||||
// sampleNetworkFee samples the current fee rate on the network to get into the
|
||||
@@ -962,7 +962,7 @@ func (l *channelLink) htlcManager() {
|
||||
// only attempt to resolve packages if our short chan id indicates that
|
||||
// the channel is not pending, otherwise we should have no htlcs to
|
||||
// reforward.
|
||||
if l.ShortChanID() != sourceHop {
|
||||
if l.ShortChanID() != hop.Source {
|
||||
if err := l.resolveFwdPkgs(); err != nil {
|
||||
l.fail(LinkFailureError{code: ErrInternalError},
|
||||
"unable to resolve fwd pkgs: %v", err)
|
||||
@@ -2076,7 +2076,7 @@ func (l *channelLink) UpdateShortChanID() (lnwire.ShortChannelID, error) {
|
||||
if err != nil {
|
||||
l.errorf("unable to refresh short_chan_id for chan_id=%v: %v",
|
||||
chanID, err)
|
||||
return sourceHop, err
|
||||
return hop.Source, err
|
||||
}
|
||||
|
||||
sid := l.channel.ShortChanID()
|
||||
@@ -2675,7 +2675,7 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
|
||||
}
|
||||
|
||||
switch fwdInfo.NextHop {
|
||||
case exitHop:
|
||||
case hop.Exit:
|
||||
updated, err := l.processExitHop(
|
||||
pd, obfuscator, fwdInfo, heightNow,
|
||||
chanIterator.ExtraOnionBlob(),
|
||||
|
||||
Reference in New Issue
Block a user