mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopd: arbitrary withdrawal amount for static address deposits
This commit is contained in:
parent
2622882d76
commit
c7cc47bdc3
2 changed files with 11 additions and 4 deletions
|
|
@ -148,7 +148,7 @@ var withdrawalCommand = cli.Command{
|
|||
Usage: "withdraws all static address deposits.",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "addr",
|
||||
Name: "dest_addr",
|
||||
Usage: "the optional address that the withdrawn " +
|
||||
"funds should be sent to, if let blank the " +
|
||||
"funds will go to lnd's wallet",
|
||||
|
|
@ -159,6 +159,12 @@ var withdrawalCommand = cli.Command{
|
|||
"sat/vbyte that should be used when crafting " +
|
||||
"the transaction",
|
||||
},
|
||||
cli.IntFlag{
|
||||
Name: "amount",
|
||||
Usage: "the number of satoshis that should be " +
|
||||
"withdrawn from the selected deposits. The " +
|
||||
"change is sent back to the static address",
|
||||
},
|
||||
},
|
||||
Action: withdraw,
|
||||
}
|
||||
|
|
@ -198,8 +204,8 @@ func withdraw(ctx *cli.Context) error {
|
|||
return fmt.Errorf("unknown withdrawal request")
|
||||
}
|
||||
|
||||
if ctx.IsSet("addr") {
|
||||
destAddr = ctx.String("addr")
|
||||
if ctx.IsSet("dest_addr") {
|
||||
destAddr = ctx.String("dest_addr")
|
||||
}
|
||||
|
||||
resp, err := client.WithdrawDeposits(ctxb,
|
||||
|
|
@ -208,6 +214,7 @@ func withdraw(ctx *cli.Context) error {
|
|||
All: isAllSelected,
|
||||
DestAddr: destAddr,
|
||||
SatPerVbyte: int64(ctx.Uint64("sat_per_vbyte")),
|
||||
Amount: ctx.Int64("amount"),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -1541,7 +1541,7 @@ func (s *swapClientServer) WithdrawDeposits(ctx context.Context,
|
|||
}
|
||||
|
||||
txhash, pkScript, err := s.withdrawalManager.DeliverWithdrawalRequest(
|
||||
ctx, outpoints, req.DestAddr, req.SatPerVbyte,
|
||||
ctx, outpoints, req.DestAddr, req.SatPerVbyte, req.Amount,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue