What changed, and why it matters
This commit adds a new command-line option to the `lncli estimatefee` command, allowing users to specify exact UTXOs (unspent transaction outputs) to use when estimating a transaction fee. Previously, the fee estimation relied on automatic coin selection. This is a feature addition that exposes an existing backend capability in the command-line tool; it does not, on its own, appear to fix or introduce a security vulnerability.
No security action required. Review as a normal feature addition. If desired, verify that `lnd.UtxosToOutpoints` handles malformed outpoints safely and that the backend `EstimateFee` RPC properly validates user-supplied inputs, but these are outside the scope of this diff.
Security signals we found
No security-relevant logic changes observed in the diff.
Change is a CLI feature addition exposing an existing RPC field.
No input sanitization beyond existing `lnd.UtxosToOutpoints` helper.
No mention of vulnerability, fix, security, CVE, or researcher attribution in commit message.
Evidence from the diff
The patch modifies cmd/commands/commands.go to add a --utxo flag to the estimatefee CLI command. The flag accepts one or more outpoints in txid:index format. The values are parsed via lnd.UtxosToOutpoints and passed as Inputs to the existing lnrpc.EstimateFeeRequest RPC. The backend RPC already supported the Inputs field; this change merely wires the CLI argument to it. No validation, authorization, or fee-calculation logic is changed.
Changed components
cmd/commands/commands.golncli estimatefee subcommandInspect captured patch +19 / −0
diff --git a/cmd/commands/commands.go b/cmd/commands/commands.go
index 48633c7..0c389a6 100644
--- a/cmd/commands/commands.go
+++ b/cmd/commands/commands.go
@@ -402,6 +402,14 @@ var estimateFeeCommand = cli.Command{
"transaction *should* confirm in",
},
coinSelectionStrategyFlag,
+ 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),
}
@@ -423,10 +431,21 @@ func estimateFees(ctx *cli.Context) error {
client, cleanUp := getClient(ctx)
defer cleanUp()
+ var inputs []*lnrpc.OutPoint
+ if ctx.IsSet("utxo") {
+ utxos := ctx.StringSlice("utxo")
+
+ inputs, err = lnd.UtxosToOutpoints(utxos)
+ if err != nil {
+ return fmt.Errorf("unable to decode utxos: %w", err)
+ }
+ }
+
resp, err := client.EstimateFee(ctxc, &lnrpc.EstimateFeeRequest{
AddrToAmount: amountToAddr,
TargetConf: int32(ctx.Int64("conf_target")),
CoinSelectionStrategy: coinSelectionStrategy,
+ Inputs: inputs,
})
if err != nil {
return err
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.