@@ -419,7 +419,7 @@ func (s *loopInSwap) publishOnChainHtlc(ctx context.Context) (bool, error) {
419419// the swap invoice is either settled or canceled. If the htlc times out, the
420420// timeout tx will be published.
421421func (s * loopInSwap ) waitForSwapComplete (ctx context.Context ,
422- htlc * wire.OutPoint , htlcValue btcutil.Amount ) error {
422+ htlcOutpoint * wire.OutPoint , htlcValue btcutil.Amount ) error {
423423
424424 // Register the htlc spend notification.
425425 rpcCtx , cancel := context .WithCancel (ctx )
@@ -445,7 +445,7 @@ func (s *loopInSwap) waitForSwapComplete(ctx context.Context,
445445 // checkTimeout publishes the timeout tx if the contract has expired.
446446 checkTimeout := func () error {
447447 if s .height >= s .LoopInContract .CltvExpiry {
448- return s .publishTimeoutTx (ctx , htlc )
448+ return s .publishTimeoutTx (ctx , htlcOutpoint , htlcValue )
449449 }
450450
451451 return nil
@@ -572,7 +572,7 @@ func (s *loopInSwap) processHtlcSpend(ctx context.Context,
572572// publishTimeoutTx publishes a timeout tx after the on-chain htlc has expired.
573573// The swap failed and we are reclaiming our funds.
574574func (s * loopInSwap ) publishTimeoutTx (ctx context.Context ,
575- htlc * wire.OutPoint ) error {
575+ htlcOutpoint * wire.OutPoint , htlcValue btcutil. Amount ) error {
576576
577577 if s .timeoutAddr == nil {
578578 var err error
@@ -596,8 +596,8 @@ func (s *loopInSwap) publishTimeoutTx(ctx context.Context,
596596 }
597597
598598 timeoutTx , err := s .sweeper .CreateSweepTx (
599- ctx , s .height , s .htlc , * htlc , s .SenderKey , witnessFunc ,
600- s . LoopInContract . AmountRequested , fee , s .timeoutAddr ,
599+ ctx , s .height , s .htlc , * htlcOutpoint , s .SenderKey , witnessFunc ,
600+ htlcValue , fee , s .timeoutAddr ,
601601 )
602602 if err != nil {
603603 return err
0 commit comments