multi: expose confirmation target for loop out HTLC sweep

This commit is contained in:
Wilmer Paulino 2019-06-25 14:41:49 -04:00
parent a138790822
commit c16e170338
No known key found for this signature in database
GPG key ID: 6DF57B9F9514972F
6 changed files with 116 additions and 70 deletions

View file

@ -41,6 +41,13 @@ func (s *swapClientServer) LoopOut(ctx context.Context,
logger.Infof("Loop out request received")
sweepConfTarget, err := validateConfTarget(
in.SweepConfTarget, loop.DefaultSweepConfTarget,
)
if err != nil {
return nil, err
}
var sweepAddr btcutil.Address
if in.Dest == "" {
// Generate sweep address if none specified.
@ -67,7 +74,7 @@ func (s *swapClientServer) LoopOut(ctx context.Context,
MaxPrepayRoutingFee: btcutil.Amount(in.MaxPrepayRoutingFee),
MaxSwapRoutingFee: btcutil.Amount(in.MaxSwapRoutingFee),
MaxSwapFee: btcutil.Amount(in.MaxSwapFee),
SweepConfTarget: defaultConfTarget,
SweepConfTarget: sweepConfTarget,
}
if in.LoopOutChannel != 0 {
req.LoopOutChannel = &in.LoopOutChannel
@ -249,7 +256,9 @@ func (s *swapClientServer) LoopOutTerms(ctx context.Context,
func (s *swapClientServer) LoopOutQuote(ctx context.Context,
req *looprpc.QuoteRequest) (*looprpc.QuoteResponse, error) {
confTarget, err := validateConfTarget(req.ConfTarget, defaultConfTarget)
confTarget, err := validateConfTarget(
req.ConfTarget, loop.DefaultSweepConfTarget,
)
if err != nil {
return nil, err
}