cmd: add outgoing_chan_id flag to estimatefee
What changed, and why it matters
This commit adds a new command-line option called outgoing_chan_id to the estimatefee command in LND. It lets users tell the fee estimator which payment channel(s) to consider for the first hop. There is nothing in the change that fixes a bug or addresses a security issue; it is a straightforward feature addition.
No security action required. Review as a normal feature addition if desired.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds a cli.StringSliceFlag named outgoing_chan_id to the estimateRouteFeeCommand definition and wires it into the EstimateRouteFee RPC request via req.OutgoingChanIds. The values are parsed with the existing parseChanIDs helper. No validation, RPC, or cryptographic logic is changed beyond plumbing the new parameter.
Changed components
cmd/commands/cmd_payments.goestimatefee CLI commandInspect captured patch +18 / −0
diff --git a/cmd/commands/cmd_payments.go b/cmd/commands/cmd_payments.go
index be7dc3d..961709a 100644
--- a/cmd/commands/cmd_payments.go
+++ b/cmd/commands/cmd_payments.go
@@ -2094,6 +2094,15 @@ var estimateRouteFeeCommand = cli.Command{
"applicable if pay_req is specified.",
Value: paymentTimeout,
},
+ cli.StringSliceFlag{
+ Name: "outgoing_chan_id",
+ Usage: "short channel id of the outgoing channel " +
+ "to use for the first hop of the fee " +
+ "estimation; if specified multiple " +
+ "times, only the listed channels are " +
+ "considered for the first hop",
+ Value: &cli.StringSlice{},
+ },
},
}
@@ -2140,6 +2149,15 @@ func estimateRouteFee(ctx *cli.Context) error {
return fmt.Errorf("fee estimation arguments missing")
}
+ var (
+ err error
+ outChanIDs = ctx.StringSlice("outgoing_chan_id")
+ )
+ req.OutgoingChanIds, err = parseChanIDs(outChanIDs)
+ if err != nil {
+ return fmt.Errorf("unable to decode outgoing_chan_id: %w", err)
+ }
+
resp, err := client.EstimateRouteFee(ctxc, req)
if err != nil {
return err
Why this scored 15/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.