loopd call swapserver with SwapPublicationDeadline set

This commit is contained in:
Johan T. Halseth 2020-01-07 13:52:42 +01:00
parent 18608a6aa3
commit b2d1d99521
No known key found for this signature in database
GPG key ID: 15BAADA29DA20D26
2 changed files with 7 additions and 0 deletions

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.

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