routing: rename route variable to prevent clash with package

This commit is contained in:
Joost Jager 2019-12-11 08:41:59 +01:00
parent eae45f9ad9
commit b8abae6a7e
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7

@ -239,7 +239,7 @@ func (p *paymentLifecycle) createNewPaymentAttempt() (lnwire.ShortChannelID,
} }
// Create a new payment attempt from the given payment session. // Create a new payment attempt from the given payment session.
route, err := p.paySession.RequestRoute( rt, err := p.paySession.RequestRoute(
p.payment, uint32(p.currentHeight), p.finalCLTVDelta, p.payment, uint32(p.currentHeight), p.finalCLTVDelta,
) )
if err != nil { if err != nil {
@ -279,7 +279,7 @@ func (p *paymentLifecycle) createNewPaymentAttempt() (lnwire.ShortChannelID,
// with the htlcAdd message that we send directly to the // with the htlcAdd message that we send directly to the
// switch. // switch.
onionBlob, c, err := generateSphinxPacket( onionBlob, c, err := generateSphinxPacket(
route, p.payment.PaymentHash[:], sessionKey, rt, p.payment.PaymentHash[:], sessionKey,
) )
if err != nil { if err != nil {
return lnwire.ShortChannelID{}, nil, err return lnwire.ShortChannelID{}, nil, err
@ -293,8 +293,8 @@ func (p *paymentLifecycle) createNewPaymentAttempt() (lnwire.ShortChannelID,
// metadata within this packet will be used to route the // metadata within this packet will be used to route the
// payment through the network, starting with the first-hop. // payment through the network, starting with the first-hop.
htlcAdd := &lnwire.UpdateAddHTLC{ htlcAdd := &lnwire.UpdateAddHTLC{
Amount: route.TotalAmount, Amount: rt.TotalAmount,
Expiry: route.TotalTimeLock, Expiry: rt.TotalTimeLock,
PaymentHash: p.payment.PaymentHash, PaymentHash: p.payment.PaymentHash,
} }
copy(htlcAdd.OnionBlob[:], onionBlob) copy(htlcAdd.OnionBlob[:], onionBlob)
@ -303,7 +303,7 @@ func (p *paymentLifecycle) createNewPaymentAttempt() (lnwire.ShortChannelID,
// the payment. If this attempt fails, then we'll continue on // the payment. If this attempt fails, then we'll continue on
// to the next available route. // to the next available route.
firstHop := lnwire.NewShortChanIDFromInt( firstHop := lnwire.NewShortChanIDFromInt(
route.Hops[0].ChannelID, rt.Hops[0].ChannelID,
) )
// We generate a new, unique payment ID that we will use for // We generate a new, unique payment ID that we will use for
@ -318,7 +318,7 @@ func (p *paymentLifecycle) createNewPaymentAttempt() (lnwire.ShortChannelID,
p.attempt = &channeldb.PaymentAttemptInfo{ p.attempt = &channeldb.PaymentAttemptInfo{
PaymentID: paymentID, PaymentID: paymentID,
SessionKey: sessionKey, SessionKey: sessionKey,
Route: *route, Route: *rt,
} }
// Before sending this HTLC to the switch, we checkpoint the // Before sending this HTLC to the switch, we checkpoint the