Skip to content

Commit a1dfee4

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.
1 parent 7e0797e commit a1dfee4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
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)

0 commit comments

Comments
 (0)