invoices/invoiceregistry: rename updateCtx to ctx
This commit is contained in:
parent
e80e21d1a8
commit
2799202fd9
@ -733,11 +733,9 @@ func (i *InvoiceRegistry) NotifyExitHopHtlc(rHash lntypes.Hash,
|
|||||||
circuitKey channeldb.CircuitKey, hodlChan chan<- interface{},
|
circuitKey channeldb.CircuitKey, hodlChan chan<- interface{},
|
||||||
payload Payload) (HtlcResolution, error) {
|
payload Payload) (HtlcResolution, error) {
|
||||||
|
|
||||||
mpp := payload.MultiPath()
|
|
||||||
|
|
||||||
// Create the update context containing the relevant details of the
|
// Create the update context containing the relevant details of the
|
||||||
// incoming htlc.
|
// incoming htlc.
|
||||||
updateCtx := invoiceUpdateCtx{
|
ctx := invoiceUpdateCtx{
|
||||||
hash: rHash,
|
hash: rHash,
|
||||||
circuitKey: circuitKey,
|
circuitKey: circuitKey,
|
||||||
amtPaid: amtPaid,
|
amtPaid: amtPaid,
|
||||||
@ -745,16 +743,16 @@ func (i *InvoiceRegistry) NotifyExitHopHtlc(rHash lntypes.Hash,
|
|||||||
currentHeight: currentHeight,
|
currentHeight: currentHeight,
|
||||||
finalCltvRejectDelta: i.cfg.FinalCltvRejectDelta,
|
finalCltvRejectDelta: i.cfg.FinalCltvRejectDelta,
|
||||||
customRecords: payload.CustomRecords(),
|
customRecords: payload.CustomRecords(),
|
||||||
mpp: mpp,
|
mpp: payload.MultiPath(),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process keysend if present. Do this outside of the lock, because
|
// Process keysend if present. Do this outside of the lock, because
|
||||||
// AddInvoice obtains its own lock. This is no problem, because the
|
// AddInvoice obtains its own lock. This is no problem, because the
|
||||||
// operation is idempotent.
|
// operation is idempotent.
|
||||||
if i.cfg.AcceptKeySend {
|
if i.cfg.AcceptKeySend {
|
||||||
err := i.processKeySend(updateCtx)
|
err := i.processKeySend(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
updateCtx.log(fmt.Sprintf("keysend error: %v", err))
|
ctx.log(fmt.Sprintf("keysend error: %v", err))
|
||||||
|
|
||||||
return NewFailResolution(
|
return NewFailResolution(
|
||||||
circuitKey, currentHeight, ResultKeySendError,
|
circuitKey, currentHeight, ResultKeySendError,
|
||||||
@ -764,7 +762,7 @@ func (i *InvoiceRegistry) NotifyExitHopHtlc(rHash lntypes.Hash,
|
|||||||
|
|
||||||
// Execute locked notify exit hop logic.
|
// Execute locked notify exit hop logic.
|
||||||
i.Lock()
|
i.Lock()
|
||||||
resolution, err := i.notifyExitHopHtlcLocked(&updateCtx, hodlChan)
|
resolution, err := i.notifyExitHopHtlcLocked(&ctx, hodlChan)
|
||||||
i.Unlock()
|
i.Unlock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user