Browse Source

loopd call swapserver with SwapPublicationDeadline set

pull/129/head
Johan T. Halseth 1 year ago
parent
commit
b2d1d99521
No known key found for this signature in database GPG Key ID: 15BAADA29DA20D26
2 changed files with 7 additions and 0 deletions
  1. +4
    -0
      interface.go
  2. +3
    -0
      loopd/swapclient_server.go

+ 4
- 0
interface.go View File

@ -99,6 +99,10 @@ type LoopOutQuoteRequest struct {
// client sweep tx.
SweepConfTarget int32
// SwapPublicationDeadline can be set by the client to allow the server
// delaying publication of the swap HTLC to save on chain fees.
SwapPublicationDeadline time.Time
// TODO: Add argument to specify confirmation target for server
// publishing htlc. This may influence the swap fee quote, because the
// server needs to pay more for faster confirmations.

+ 3
- 0
loopd/swapclient_server.go View File

@ -266,6 +266,9 @@ func (s *swapClientServer) LoopOutQuote(ctx context.Context,
quote, err := s.impl.LoopOutQuote(ctx, &loop.LoopOutQuoteRequest{
Amount: btcutil.Amount(req.Amt),
SweepConfTarget: confTarget,
SwapPublicationDeadline: time.Unix(
int64(req.SwapPublicationDeadline), 0,
),
})
if err != nil {
return nil, err

Loading…
Cancel
Save