Skip to content

Commit b2d1d99

Browse files
committed
loopd call swapserver with SwapPublicationDeadline set
1 parent 18608a6 commit b2d1d99

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

interface.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ type LoopOutQuoteRequest struct {
9999
// client sweep tx.
100100
SweepConfTarget int32
101101

102+
// SwapPublicationDeadline can be set by the client to allow the server
103+
// delaying publication of the swap HTLC to save on chain fees.
104+
SwapPublicationDeadline time.Time
105+
102106
// TODO: Add argument to specify confirmation target for server
103107
// publishing htlc. This may influence the swap fee quote, because the
104108
// server needs to pay more for faster confirmations.

loopd/swapclient_server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ func (s *swapClientServer) LoopOutQuote(ctx context.Context,
266266
quote, err := s.impl.LoopOutQuote(ctx, &loop.LoopOutQuoteRequest{
267267
Amount: btcutil.Amount(req.Amt),
268268
SweepConfTarget: confTarget,
269+
SwapPublicationDeadline: time.Unix(
270+
int64(req.SwapPublicationDeadline), 0,
271+
),
269272
})
270273
if err != nil {
271274
return nil, err

0 commit comments

Comments
 (0)