@@ -749,7 +749,7 @@ func (s *swapClientServer) GetLoopInQuote(ctx context.Context,
749749 log .Infof ("Loop in quote request received" )
750750
751751 htlcConfTarget , err := validateLoopInRequest (
752- req .ConfTarget , req .ExternalHtlc ,
752+ req .ConfTarget , req .ExternalHtlc , req . NumDeposits ,
753753 )
754754 if err != nil {
755755 return nil , err
@@ -785,6 +785,7 @@ func (s *swapClientServer) GetLoopInQuote(ctx context.Context,
785785 RouteHints : routeHints ,
786786 Private : req .Private ,
787787 Initiator : defaultLoopdInitiator ,
788+ NumDeposits : req .NumDeposits ,
788789 })
789790 if err != nil {
790791 return nil , err
@@ -881,7 +882,7 @@ func (s *swapClientServer) LoopIn(ctx context.Context,
881882 log .Infof ("Loop in request received" )
882883
883884 htlcConfTarget , err := validateLoopInRequest (
884- in .HtlcConfTarget , in .ExternalHtlc ,
885+ in .HtlcConfTarget , in .ExternalHtlc , 0 ,
885886 )
886887 if err != nil {
887888 return nil , err
@@ -1674,7 +1675,9 @@ func validateConfTarget(target, defaultTarget int32) (int32, error) {
16741675
16751676// validateLoopInRequest fails if the mutually exclusive conf target and
16761677// external parameters are both set.
1677- func validateLoopInRequest (htlcConfTarget int32 , external bool ) (int32 , error ) {
1678+ func validateLoopInRequest (htlcConfTarget int32 , external bool ,
1679+ numDeposits uint32 ) (int32 , error ) {
1680+
16781681 // If the htlc is going to be externally set, the htlcConfTarget should
16791682 // not be set, because it has no relevance when the htlc is external.
16801683 if external && htlcConfTarget != 0 {
@@ -1688,6 +1691,12 @@ func validateLoopInRequest(htlcConfTarget int32, external bool) (int32, error) {
16881691 return 0 , nil
16891692 }
16901693
1694+ // If the loop in uses static address deposits, we do not need to set a
1695+ // confirmation target since the HTLC won't be published by the client.
1696+ if numDeposits > 0 {
1697+ return 0 , nil
1698+ }
1699+
16911700 return validateConfTarget (htlcConfTarget , loop .DefaultHtlcConfTarget )
16921701}
16931702
0 commit comments