mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-13 18:10:25 +02:00
walletkit: add startheight parameter to ListSweeps
By default ListSweeps will list all sweeps known to the wallet. Over time this may become expensive to call and callers may not be interested in the full history. This commit adds a `startheight` parameter to the `ListSweeps` RPC call. This parameter can be used to fetch sweeps only from a specified start block height or only unconfirmed ones if it is set to -1.
This commit is contained in:
@@ -455,6 +455,14 @@ var listSweepsCommand = cli.Command{
|
||||
Name: "verbose",
|
||||
Usage: "lookup full transaction",
|
||||
},
|
||||
cli.IntFlag{
|
||||
Name: "startheight",
|
||||
Usage: "The start height to use when fetching " +
|
||||
"sweeps. If not specified (0), the result " +
|
||||
"will start from the earliest sweep. If set " +
|
||||
"to -1 the result will only include " +
|
||||
"unconfirmed sweeps (at the time of the call).",
|
||||
},
|
||||
},
|
||||
Description: `
|
||||
Get a list of the hex-encoded transaction ids of every sweep that our
|
||||
@@ -474,7 +482,8 @@ func listSweeps(ctx *cli.Context) error {
|
||||
|
||||
resp, err := client.ListSweeps(
|
||||
ctxc, &walletrpc.ListSweepsRequest{
|
||||
Verbose: ctx.IsSet("verbose"),
|
||||
Verbose: ctx.IsSet("verbose"),
|
||||
StartHeight: int32(ctx.Int("startheight")),
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user