Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions cmd/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,20 @@
"transaction *should* confirm in",
},
coinSelectionStrategyFlag,
cli.BoolFlag{
Name: "show_outpoints",
Usage: "(optional) if set, the outpoints that will " +
"be used for the transaction will be printed " +
"to the console",
},
cli.StringSliceFlag{
Name: "utxo",
Usage: "a utxo specified as outpoint(tx:idx) which " +
"will be used as input for the transaction " +
"to be estimated. This flag can be " +
"repeatedly used to specify multiple utxos " +
"as inputs.",
},
},
Action: actionDecorator(estimateFees),
}
Expand All @@ -423,10 +437,23 @@
client, cleanUp := getClient(ctx)
defer cleanUp()

var outpoints []*lnrpc.OutPoint
if ctx.IsSet("utxo") {
utxos := ctx.StringSlice("utxo")

outpoints, err = UtxosToOutpoints(utxos)
if err != nil {
return fmt.Errorf("unable to decode utxos: %w", err)
}

}

Check failure on line 449 in cmd/commands/commands.go

View workflow job for this annotation

GitHub Actions / Lint code

unnecessary trailing newline (whitespace)

resp, err := client.EstimateFee(ctxc, &lnrpc.EstimateFeeRequest{
AddrToAmount: amountToAddr,
TargetConf: int32(ctx.Int64("conf_target")),
CoinSelectionStrategy: coinSelectionStrategy,
Outpoints: outpoints,
ShowOutpoints: ctx.Bool("show_outpoints"),
})
if err != nil {
return err
Expand Down
Loading
Loading