@@ -419,7 +419,7 @@ func (s *loopInSwap) publishOnChainHtlc(ctx context.Context) (bool, error) {
419
419
// the swap invoice is either settled or canceled. If the htlc times out, the
420
420
// timeout tx will be published.
421
421
func (s * loopInSwap ) waitForSwapComplete (ctx context.Context ,
422
- htlc * wire.OutPoint , htlcValue btcutil.Amount ) error {
422
+ htlcOutpoint * wire.OutPoint , htlcValue btcutil.Amount ) error {
423
423
424
424
// Register the htlc spend notification.
425
425
rpcCtx , cancel := context .WithCancel (ctx )
@@ -445,7 +445,7 @@ func (s *loopInSwap) waitForSwapComplete(ctx context.Context,
445
445
// checkTimeout publishes the timeout tx if the contract has expired.
446
446
checkTimeout := func () error {
447
447
if s .height >= s .LoopInContract .CltvExpiry {
448
- return s .publishTimeoutTx (ctx , htlc )
448
+ return s .publishTimeoutTx (ctx , htlcOutpoint , htlcValue )
449
449
}
450
450
451
451
return nil
@@ -572,7 +572,7 @@ func (s *loopInSwap) processHtlcSpend(ctx context.Context,
572
572
// publishTimeoutTx publishes a timeout tx after the on-chain htlc has expired.
573
573
// The swap failed and we are reclaiming our funds.
574
574
func (s * loopInSwap ) publishTimeoutTx (ctx context.Context ,
575
- htlc * wire.OutPoint ) error {
575
+ htlcOutpoint * wire.OutPoint , htlcValue btcutil. Amount ) error {
576
576
577
577
if s .timeoutAddr == nil {
578
578
var err error
@@ -596,8 +596,8 @@ func (s *loopInSwap) publishTimeoutTx(ctx context.Context,
596
596
}
597
597
598
598
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 ,
601
601
)
602
602
if err != nil {
603
603
return err
0 commit comments