loop: handle fast-flag in legacy loop-in

This commit is contained in:
Slyghtning 2025-10-01 08:52:35 +02:00
parent 168420c28d
commit aaeeefee00
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF
4 changed files with 9 additions and 4 deletions

View file

@ -843,6 +843,7 @@ func (s *Client) LoopInQuote(ctx context.Context,
quote, err := s.Server.GetLoopInQuote(
ctx, request.Amount, s.lndServices.NodePubkey, request.LastHop,
request.RouteHints, request.Initiator, request.NumDeposits,
request.Fast,
)
if err != nil {
return nil, err

View file

@ -130,9 +130,11 @@ func newLoopInSwap(globalCtx context.Context, cfg *swapConfig,
// channels is an LND side black box feature. Advanced users will quote
// directly anyway and there they have the option to add specific route
// hints.
numDeposits := uint32(0)
fast := false
quote, err := cfg.server.GetLoopInQuote(
globalCtx, request.Amount, cfg.lnd.NodePubkey, request.LastHop,
request.RouteHints, request.Initiator, 0,
request.RouteHints, request.Initiator, numDeposits, fast,
)
if err != nil {
return nil, wrapGrpcError("loop in terms", err)

View file

@ -226,7 +226,7 @@ func (s *serverMock) GetLoopInTerms(ctx context.Context, initiator string) (
func (s *serverMock) GetLoopInQuote(context.Context, btcutil.Amount,
route.Vertex, *route.Vertex, [][]zpay32.HopHint, string,
uint32) (*LoopInQuote, error) {
uint32, bool) (*LoopInQuote, error) {
return &LoopInQuote{
SwapFee: testSwapFee,

View file

@ -82,7 +82,8 @@ type swapServerClient interface {
GetLoopInQuote(ctx context.Context, amt btcutil.Amount,
pubKey route.Vertex, lastHop *route.Vertex,
routeHints [][]zpay32.HopHint,
initiator string, numDeposits uint32) (*LoopInQuote, error)
initiator string, numDeposits uint32,
fast bool) (*LoopInQuote, error)
Probe(ctx context.Context, amt btcutil.Amount, target route.Vertex,
lastHop *route.Vertex, routeHints [][]zpay32.HopHint) error
@ -269,7 +270,7 @@ func (s *grpcSwapServerClient) GetLoopInTerms(ctx context.Context,
func (s *grpcSwapServerClient) GetLoopInQuote(ctx context.Context,
amt btcutil.Amount, pubKey route.Vertex, lastHop *route.Vertex,
routeHints [][]zpay32.HopHint, initiator string,
numDeposits uint32) (*LoopInQuote, error) {
numDeposits uint32, fast bool) (*LoopInQuote, error) {
err := s.Probe(ctx, amt, pubKey, lastHop, routeHints)
if err != nil && status.Code(err) != codes.Unavailable {
@ -285,6 +286,7 @@ func (s *grpcSwapServerClient) GetLoopInQuote(ctx context.Context,
Pubkey: pubKey[:],
UserAgent: UserAgent(initiator),
NumStaticAddressDeposits: numDeposits,
Fast: fast,
}
if lastHop != nil {