|
|
|
@ -100,6 +100,7 @@ func (s *swapClientServer) LoopOut(ctx context.Context,
|
|
|
|
|
log.Infof("Loop out request received")
|
|
|
|
|
|
|
|
|
|
var sweepAddr btcutil.Address
|
|
|
|
|
var isExternalAddr bool
|
|
|
|
|
var err error
|
|
|
|
|
//nolint:lll
|
|
|
|
|
switch {
|
|
|
|
@ -117,6 +118,8 @@ func (s *swapClientServer) LoopOut(ctx context.Context,
|
|
|
|
|
return nil, fmt.Errorf("decode address: %v", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isExternalAddr = true
|
|
|
|
|
|
|
|
|
|
case in.Account != "" && in.AccountAddrType == clientrpc.AddressType_ADDRESS_TYPE_UNKNOWN:
|
|
|
|
|
return nil, liquidity.ErrAccountAndAddrType
|
|
|
|
|
|
|
|
|
@ -141,6 +144,8 @@ func (s *swapClientServer) LoopOut(ctx context.Context,
|
|
|
|
|
"%v", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isExternalAddr = true
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
// Generate sweep address if none specified.
|
|
|
|
|
sweepAddr, err = s.lnd.WalletKit.NextAddr(
|
|
|
|
@ -166,6 +171,7 @@ func (s *swapClientServer) LoopOut(ctx context.Context,
|
|
|
|
|
req := &loop.OutRequest{
|
|
|
|
|
Amount: btcutil.Amount(in.Amt),
|
|
|
|
|
DestAddr: sweepAddr,
|
|
|
|
|
IsExternalAddr: isExternalAddr,
|
|
|
|
|
MaxMinerFee: btcutil.Amount(in.MaxMinerFee),
|
|
|
|
|
MaxPrepayAmount: btcutil.Amount(in.MaxPrepayAmt),
|
|
|
|
|
MaxPrepayRoutingFee: btcutil.Amount(in.MaxPrepayRoutingFee),
|
|
|
|
|