Skip to content

Commit ea1f9ff

Browse files
committed
looprpc: add SwapPublicationDeadline to client proto
cmd/loopd swapclient_server: use SwapPublicationDeadline from LoopOutRequest
1 parent c70d0de commit ea1f9ff

File tree

4 files changed

+106
-72
lines changed

4 files changed

+106
-72
lines changed

cmd/loopd/swapclient_server.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"fmt"
77
"sort"
8+
"time"
89

910
"github.com/lightningnetwork/lnd/queue"
1011

@@ -76,6 +77,9 @@ func (s *swapClientServer) LoopOut(ctx context.Context,
7677
MaxSwapRoutingFee: btcutil.Amount(in.MaxSwapRoutingFee),
7778
MaxSwapFee: btcutil.Amount(in.MaxSwapFee),
7879
SweepConfTarget: sweepConfTarget,
80+
SwapPublicationDeadline: time.Unix(
81+
int64(in.SwapPublicationDeadline), 0,
82+
),
7983
}
8084
if in.LoopOutChannel != 0 {
8185
req.LoopOutChannel = &in.LoopOutChannel

looprpc/client.pb.go

Lines changed: 88 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

looprpc/client.proto

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ message LoopOutRequest {
146146
should be swept within.
147147
*/
148148
int32 sweep_conf_target = 9;
149+
150+
/**
151+
The latest time (in unix seconds) we allow the server to wait before
152+
publishing the HTLC on chain. Setting this to a larger value will give the
153+
server the opportunity to batch multiple swaps together, and wait for
154+
low-fee periods before publishing the HTLC, potentially resulting in a
155+
lower total swap fee.
156+
*/
157+
uint64 swap_publication_deadline = 10;
149158
}
150159

151160
message LoopInRequest {

looprpc/client.swagger.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,11 @@
265265
"type": "integer",
266266
"format": "int32",
267267
"description": "*\nThe number of blocks from the on-chain HTLC's confirmation height that it\nshould be swept within."
268+
},
269+
"swap_publication_deadline": {
270+
"type": "string",
271+
"format": "uint64",
272+
"description": "*\nThe latest time (in unix seconds) we allow the server to wait before\npublishing the HTLC on chain. Setting this to a larger value will give the\nserver the opportunity to batch multiple swaps together, and wait for\nlow-fee periods before publishing the HTLC, potentially resulting in a\nlower total swap fee."
268273
}
269274
}
270275
},

0 commit comments

Comments
 (0)