mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopd: receive external HTLC flag in loop in quote request
This commit is contained in:
parent
be9a2b9a47
commit
489ab5620e
3 changed files with 14 additions and 0 deletions
|
|
@ -470,6 +470,15 @@ func (s *Client) LoopInQuote(ctx context.Context,
|
|||
request.Amount*btcutil.Amount(terms.SwapFeeRate)/
|
||||
btcutil.Amount(swap.FeeRateTotalParts)
|
||||
|
||||
// We don't calculate the on-chain fee if the HTLC is going to be
|
||||
// published externally.
|
||||
if request.ExternalHtlc {
|
||||
return &LoopInQuote{
|
||||
SwapFee: swapFee,
|
||||
MinerFee: 0,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Get estimate for miner fee.
|
||||
minerFee, err := s.lndServices.Client.EstimateFeeToP2WSH(
|
||||
ctx, request.Amount, request.HtlcConfTarget,
|
||||
|
|
|
|||
|
|
@ -306,6 +306,7 @@ func (s *swapClientServer) GetLoopInQuote(ctx context.Context,
|
|||
quote, err := s.impl.LoopInQuote(ctx, &loop.LoopInQuoteRequest{
|
||||
Amount: btcutil.Amount(req.Amt),
|
||||
HtlcConfTarget: defaultConfTarget,
|
||||
ExternalHtlc: req.ExternalHtlc,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -224,6 +224,10 @@ type LoopInQuoteRequest struct {
|
|||
// HtlcConfTarget specifies the targeted confirmation target for the
|
||||
// client sweep tx.
|
||||
HtlcConfTarget int32
|
||||
|
||||
// ExternalHtlc specifies whether the htlc is published by an external
|
||||
// source.
|
||||
ExternalHtlc bool
|
||||
}
|
||||
|
||||
// LoopInQuote contains estimates for the fees making up the total swap cost
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue