loopd: fast-flag in GetLoopInQuote and StaticAddressLoopIn

This commit is contained in:
Slyghtning 2025-10-01 08:52:08 +02:00
parent 51258af025
commit 168420c28d
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF

View file

@ -908,6 +908,14 @@ func (s *swapClientServer) GetLoopInQuote(ctx context.Context,
return nil, err
}
// The fast flag is only available for static loop in quote requests.
if req.Fast {
if !autoSelectDeposits && len(req.DepositOutpoints) == 0 {
return nil, fmt.Errorf("fast flag is only " +
"available for static address requests")
}
}
// If deposits should be automatically selected, we do so and count the
// number of deposits to quote for.
numDeposits := 0
@ -1025,6 +1033,7 @@ func (s *swapClientServer) GetLoopInQuote(ctx context.Context,
Private: req.Private,
Initiator: defaultLoopdInitiator,
NumDeposits: uint32(numDeposits),
Fast: req.Fast,
})
if err != nil {
return nil, err
@ -2052,6 +2061,7 @@ func (s *swapClientServer) StaticAddressLoopIn(ctx context.Context,
Private: in.Private,
RouteHints: routeHints,
PaymentTimeoutSeconds: in.PaymentTimeoutSeconds,
Fast: in.Fast,
}
if in.LastHop != nil {