Skip to content

Commit 83cbc7e

Browse files
committed
cli: fix --amount flag in static in and withdraw
Also fix --sat_per_vbyte flag. All these flags were accessed using wrong type (signed vs unsigned int). Previous version always parsed them as 0 even when set. Regenerate the manual.
1 parent 7e0797e commit 83cbc7e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cmd/loop/staticaddr.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ var withdrawalCommand = &cli.Command{
151151
"funds should be sent to, if let blank the " +
152152
"funds will go to lnd's wallet",
153153
},
154-
&cli.Int64Flag{
154+
&cli.Uint64Flag{
155155
Name: "sat_per_vbyte",
156156
Usage: "(optional) a manual fee expressed in " +
157157
"sat/vbyte that should be used when crafting " +
158158
"the transaction",
159159
},
160-
&cli.IntFlag{
160+
&cli.Uint64Flag{
161161
Name: "amount",
162162
Usage: "the number of satoshis that should be " +
163163
"withdrawn from the selected deposits. The " +
@@ -211,7 +211,7 @@ func withdraw(ctx context.Context, cmd *cli.Command) error {
211211
All: isAllSelected,
212212
DestAddr: destAddr,
213213
SatPerVbyte: int64(cmd.Uint64("sat_per_vbyte")),
214-
Amount: cmd.Int64("amount"),
214+
Amount: int64(cmd.Uint64("amount")),
215215
})
216216
if err != nil {
217217
return err
@@ -514,7 +514,7 @@ func staticAddressLoopIn(ctx context.Context, cmd *cli.Command) error {
514514
"allowed")
515515

516516
default:
517-
selectedAmount = cmd.Int64("amount")
517+
selectedAmount = int64(cmd.Uint64("amount"))
518518
}
519519

520520
client, cleanup, err := getClient(ctx, cmd)

docs/loop.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,8 @@ The following flags are supported:
590590
| `--utxo="…"` | specify utxos as outpoints(tx:idx) which willbe withdrawn | string | `[]` |
591591
| `--all` | withdraws all static address deposits | bool | `false` |
592592
| `--dest_addr="…"` | the optional address that the withdrawn funds should be sent to, if let blank the funds will go to lnd's wallet | string |
593-
| `--sat_per_vbyte="…"` | (optional) a manual fee expressed in sat/vbyte that should be used when crafting the transaction | int | `0` |
594-
| `--amount="…"` | the number of satoshis that should be withdrawn from the selected deposits. The change is sent back to the static address | int | `0` |
593+
| `--sat_per_vbyte="…"` | (optional) a manual fee expressed in sat/vbyte that should be used when crafting the transaction | uint | `0` |
594+
| `--amount="…"` | the number of satoshis that should be withdrawn from the selected deposits. The change is sent back to the static address | uint | `0` |
595595
| `--help` (`-h`) | show help | bool | `false` |
596596

597597
### `static summary` subcommand (aliases: `s`)

0 commit comments

Comments
 (0)