mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
multi: use isExternalAddr flag
This commit is contained in:
parent
627eb5cb68
commit
a9be69b281
7 changed files with 25 additions and 0 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue