From 2799202fd968c5eca45591c6b1dda93df95e875d Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Thu, 21 May 2020 15:36:44 -0700 Subject: [PATCH] invoices/invoiceregistry: rename updateCtx to ctx --- invoices/invoiceregistry.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/invoices/invoiceregistry.go b/invoices/invoiceregistry.go index 662a8a82..4c1d9b2a 100644 --- a/invoices/invoiceregistry.go +++ b/invoices/invoiceregistry.go @@ -733,11 +733,9 @@ func (i *InvoiceRegistry) NotifyExitHopHtlc(rHash lntypes.Hash, circuitKey channeldb.CircuitKey, hodlChan chan<- interface{}, payload Payload) (HtlcResolution, error) { - mpp := payload.MultiPath() - // Create the update context containing the relevant details of the // incoming htlc. - updateCtx := invoiceUpdateCtx{ + ctx := invoiceUpdateCtx{ hash: rHash, circuitKey: circuitKey, amtPaid: amtPaid, @@ -745,16 +743,16 @@ func (i *InvoiceRegistry) NotifyExitHopHtlc(rHash lntypes.Hash, currentHeight: currentHeight, finalCltvRejectDelta: i.cfg.FinalCltvRejectDelta, customRecords: payload.CustomRecords(), - mpp: mpp, + mpp: payload.MultiPath(), } // Process keysend if present. Do this outside of the lock, because // AddInvoice obtains its own lock. This is no problem, because the // operation is idempotent. if i.cfg.AcceptKeySend { - err := i.processKeySend(updateCtx) + err := i.processKeySend(ctx) if err != nil { - updateCtx.log(fmt.Sprintf("keysend error: %v", err)) + ctx.log(fmt.Sprintf("keysend error: %v", err)) return NewFailResolution( circuitKey, currentHeight, ResultKeySendError, @@ -764,7 +762,7 @@ func (i *InvoiceRegistry) NotifyExitHopHtlc(rHash lntypes.Hash, // Execute locked notify exit hop logic. i.Lock() - resolution, err := i.notifyExitHopHtlcLocked(&updateCtx, hodlChan) + resolution, err := i.notifyExitHopHtlcLocked(&ctx, hodlChan) i.Unlock() if err != nil { return nil, err