From 83cbc7e30fcfda8695a7ca175a198a6b0128a86e Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Fri, 24 Oct 2025 19:08:27 -0300 Subject: [PATCH] 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. --- cmd/loop/staticaddr.go | 8 ++++---- docs/loop.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/loop/staticaddr.go b/cmd/loop/staticaddr.go index 27e07433a..5437d165b 100644 --- a/cmd/loop/staticaddr.go +++ b/cmd/loop/staticaddr.go @@ -151,13 +151,13 @@ var withdrawalCommand = &cli.Command{ "funds should be sent to, if let blank the " + "funds will go to lnd's wallet", }, - &cli.Int64Flag{ + &cli.Uint64Flag{ Name: "sat_per_vbyte", Usage: "(optional) a manual fee expressed in " + "sat/vbyte that should be used when crafting " + "the transaction", }, - &cli.IntFlag{ + &cli.Uint64Flag{ Name: "amount", Usage: "the number of satoshis that should be " + "withdrawn from the selected deposits. The " + @@ -211,7 +211,7 @@ func withdraw(ctx context.Context, cmd *cli.Command) error { All: isAllSelected, DestAddr: destAddr, SatPerVbyte: int64(cmd.Uint64("sat_per_vbyte")), - Amount: cmd.Int64("amount"), + Amount: int64(cmd.Uint64("amount")), }) if err != nil { return err @@ -514,7 +514,7 @@ func staticAddressLoopIn(ctx context.Context, cmd *cli.Command) error { "allowed") default: - selectedAmount = cmd.Int64("amount") + selectedAmount = int64(cmd.Uint64("amount")) } client, cleanup, err := getClient(ctx, cmd) diff --git a/docs/loop.md b/docs/loop.md index 8f3461e81..99e55843d 100644 --- a/docs/loop.md +++ b/docs/loop.md @@ -590,8 +590,8 @@ The following flags are supported: | `--utxo="…"` | specify utxos as outpoints(tx:idx) which willbe withdrawn | string | `[]` | | `--all` | withdraws all static address deposits | bool | `false` | | `--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 | -| `--sat_per_vbyte="…"` | (optional) a manual fee expressed in sat/vbyte that should be used when crafting the transaction | int | `0` | -| `--amount="…"` | the number of satoshis that should be withdrawn from the selected deposits. The change is sent back to the static address | int | `0` | +| `--sat_per_vbyte="…"` | (optional) a manual fee expressed in sat/vbyte that should be used when crafting the transaction | uint | `0` | +| `--amount="…"` | the number of satoshis that should be withdrawn from the selected deposits. The change is sent back to the static address | uint | `0` | | `--help` (`-h`) | show help | bool | `false` | ### `static summary` subcommand (aliases: `s`)