mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loop: handle fast-flag in legacy loop-in
This commit is contained in:
parent
168420c28d
commit
aaeeefee00
4 changed files with 9 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue