multi: rename ChannelUpdate to ChannelUpdate1
In preparation for adding a new ChannelUpdate2 message and a ChannelUpdate interface, we rename the existing message to ChannelUpdate1.
This commit is contained in:
43 files changed
+198
-172
No files matched your search
+12
-11
@@ -120,7 +120,8 @@ type ChannelLinkConfig struct {
|
||||
// specified when we receive an incoming HTLC. This will be used to
|
||||
// provide payment senders our latest policy when sending encrypted
|
||||
// error messages.
|
||||
FetchLastChannelUpdate func(lnwire.ShortChannelID) (*lnwire.ChannelUpdate, error)
|
||||
FetchLastChannelUpdate func(lnwire.ShortChannelID) (
|
||||
*lnwire.ChannelUpdate1, error)
|
||||
|
||||
// Peer is a lightning network node with which we have the channel link
|
||||
// opened.
|
||||
@@ -262,7 +263,7 @@ type ChannelLinkConfig struct {
|
||||
// FailAliasUpdate is a function used to fail an HTLC for an
|
||||
// option_scid_alias channel.
|
||||
FailAliasUpdate func(sid lnwire.ShortChannelID,
|
||||
incoming bool) *lnwire.ChannelUpdate
|
||||
incoming bool) *lnwire.ChannelUpdate1
|
||||
|
||||
// GetAliases is used by the link and switch to fetch the set of
|
||||
// aliases for a given link.
|
||||
@@ -765,7 +766,7 @@ func shouldAdjustCommitFee(netFee, chanFee,
|
||||
}
|
||||
|
||||
// failCb is used to cut down on the argument verbosity.
|
||||
type failCb func(update *lnwire.ChannelUpdate) lnwire.FailureMessage
|
||||
type failCb func(update *lnwire.ChannelUpdate1) lnwire.FailureMessage
|
||||
|
||||
// createFailureWithUpdate creates a ChannelUpdate when failing an incoming or
|
||||
// outgoing HTLC. It may return a FailureMessage that references a channel's
|
||||
@@ -2949,7 +2950,7 @@ func (l *channelLink) getAliases() []lnwire.ShortChannelID {
|
||||
//
|
||||
// Part of the scidAliasHandler interface.
|
||||
func (l *channelLink) attachFailAliasUpdate(closure func(
|
||||
sid lnwire.ShortChannelID, incoming bool) *lnwire.ChannelUpdate) {
|
||||
sid lnwire.ShortChannelID, incoming bool) *lnwire.ChannelUpdate1) {
|
||||
|
||||
l.Lock()
|
||||
l.cfg.FailAliasUpdate = closure
|
||||
@@ -3041,7 +3042,7 @@ func (l *channelLink) CheckHtlcForward(payHash [32]byte,
|
||||
|
||||
// As part of the returned error, we'll send our latest routing
|
||||
// policy so the sending node obtains the most up to date data.
|
||||
cb := func(upd *lnwire.ChannelUpdate) lnwire.FailureMessage {
|
||||
cb := func(upd *lnwire.ChannelUpdate1) lnwire.FailureMessage {
|
||||
return lnwire.NewFeeInsufficient(amtToForward, *upd)
|
||||
}
|
||||
failure := l.createFailureWithUpdate(false, originalScid, cb)
|
||||
@@ -3069,7 +3070,7 @@ func (l *channelLink) CheckHtlcForward(payHash [32]byte,
|
||||
|
||||
// Grab the latest routing policy so the sending node is up to
|
||||
// date with our current policy.
|
||||
cb := func(upd *lnwire.ChannelUpdate) lnwire.FailureMessage {
|
||||
cb := func(upd *lnwire.ChannelUpdate1) lnwire.FailureMessage {
|
||||
return lnwire.NewIncorrectCltvExpiry(
|
||||
incomingTimeout, *upd,
|
||||
)
|
||||
@@ -3118,7 +3119,7 @@ func (l *channelLink) canSendHtlc(policy models.ForwardingPolicy,
|
||||
|
||||
// As part of the returned error, we'll send our latest routing
|
||||
// policy so the sending node obtains the most up to date data.
|
||||
cb := func(upd *lnwire.ChannelUpdate) lnwire.FailureMessage {
|
||||
cb := func(upd *lnwire.ChannelUpdate1) lnwire.FailureMessage {
|
||||
return lnwire.NewAmountBelowMinimum(amt, *upd)
|
||||
}
|
||||
failure := l.createFailureWithUpdate(false, originalScid, cb)
|
||||
@@ -3133,7 +3134,7 @@ func (l *channelLink) canSendHtlc(policy models.ForwardingPolicy,
|
||||
|
||||
// As part of the returned error, we'll send our latest routing
|
||||
// policy so the sending node obtains the most up-to-date data.
|
||||
cb := func(upd *lnwire.ChannelUpdate) lnwire.FailureMessage {
|
||||
cb := func(upd *lnwire.ChannelUpdate1) lnwire.FailureMessage {
|
||||
return lnwire.NewTemporaryChannelFailure(upd)
|
||||
}
|
||||
failure := l.createFailureWithUpdate(false, originalScid, cb)
|
||||
@@ -3148,7 +3149,7 @@ func (l *channelLink) canSendHtlc(policy models.ForwardingPolicy,
|
||||
"outgoing_expiry=%v, best_height=%v", payHash[:],
|
||||
timeout, heightNow)
|
||||
|
||||
cb := func(upd *lnwire.ChannelUpdate) lnwire.FailureMessage {
|
||||
cb := func(upd *lnwire.ChannelUpdate1) lnwire.FailureMessage {
|
||||
return lnwire.NewExpiryTooSoon(*upd)
|
||||
}
|
||||
failure := l.createFailureWithUpdate(false, originalScid, cb)
|
||||
@@ -3168,7 +3169,7 @@ func (l *channelLink) canSendHtlc(policy models.ForwardingPolicy,
|
||||
if amt > l.Bandwidth() {
|
||||
l.log.Warnf("insufficient bandwidth to route htlc: %v is "+
|
||||
"larger than %v", amt, l.Bandwidth())
|
||||
cb := func(upd *lnwire.ChannelUpdate) lnwire.FailureMessage {
|
||||
cb := func(upd *lnwire.ChannelUpdate1) lnwire.FailureMessage {
|
||||
return lnwire.NewTemporaryChannelFailure(upd)
|
||||
}
|
||||
failure := l.createFailureWithUpdate(false, originalScid, cb)
|
||||
@@ -3680,7 +3681,7 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg) {
|
||||
l.log.Errorf("unable to encode the "+
|
||||
"remaining route %v", err)
|
||||
|
||||
cb := func(upd *lnwire.ChannelUpdate) lnwire.FailureMessage {
|
||||
cb := func(upd *lnwire.ChannelUpdate1) lnwire.FailureMessage { //nolint:lll
|
||||
return lnwire.NewTemporaryChannelFailure(upd)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user