routerrpc: remove deprecated SendPayment, SendToRoute, TrackPayment impls
What changed, and why it matters
This commit removes three old, deprecated payment RPC methods (SendPayment, SendToRoute, and TrackPayment) from the LND Lightning node's router service. These methods were already replaced by newer V2 versions and were only thin wrappers around them. Removing them reduces the amount of code that could contain bugs and removes their access permissions, but it may also break older client software that still calls these methods.
Treat this as a breaking API change. Operators and integrators should verify that no clients or tools rely on the removed SendPayment, SendToRoute, or TrackPayment RPCs and migrate them to the V2 equivalents. No immediate security patch is required.
Security signals we found
Removal of deprecated RPC surface reduces attack surface
Macaroon permission entries for removed methods are deleted
No new code paths or logic added
No authentication, authorization, or cryptographic changes beyond permission cleanup
Potential compatibility break for clients using deprecated endpoints
Evidence from the diff
The patch deletes the shim implementations in router_server_deprecated.go and removes the macaroon permission entries for /routerrpc.Router/SendPayment, /routerrpc.Router/SendToRoute, and /routerrpc.Router/TrackPayment from router_server.go. The deleted code delegated calls to SendPaymentV2, SendToRouteV2, and TrackPaymentV2, with small adapter logic for legacy response formats. No vulnerability is introduced by the diff itself; the change is a cleanup of deprecated surface area.
Changed components
lnrpc/routerrpc/router_server.golnrpc/routerrpc/router_server_deprecated.gorouterrpc.Router gRPC serviceInspect captured patch +0 / −126
diff --git a/lnrpc/routerrpc/router_server.go b/lnrpc/routerrpc/router_server.go
index e3ac207..23e5ace 100644
--- a/lnrpc/routerrpc/router_server.go
+++ b/lnrpc/routerrpc/router_server.go
@@ -96,10 +96,6 @@ var (
Entity: "offchain",
Action: "write",
}},
- "/routerrpc.Router/SendToRoute": {{
- Entity: "offchain",
- Action: "write",
- }},
"/routerrpc.Router/TrackPaymentV2": {{
Entity: "offchain",
Action: "read",
@@ -144,14 +140,6 @@ var (
Entity: "offchain",
Action: "read",
}},
- "/routerrpc.Router/SendPayment": {{
- Entity: "offchain",
- Action: "write",
- }},
- "/routerrpc.Router/TrackPayment": {{
- Entity: "offchain",
- Action: "read",
- }},
"/routerrpc.Router/HtlcInterceptor": {{
Entity: "offchain",
Action: "write",
diff --git a/lnrpc/routerrpc/router_server_deprecated.go b/lnrpc/routerrpc/router_server_deprecated.go
index a08cafc..4b3ed63 100644
--- a/lnrpc/routerrpc/router_server_deprecated.go
+++ b/lnrpc/routerrpc/router_server_deprecated.go
@@ -2,125 +2,11 @@ package routerrpc
import (
"context"
- "encoding/hex"
- "errors"
- "fmt"
- "github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/routing/route"
)
-// legacyTrackPaymentServer is a wrapper struct that transforms a stream of main
-// rpc payment structs into the legacy PaymentStatus format.
-type legacyTrackPaymentServer struct {
- Router_TrackPaymentServer
-}
-
-// Send converts a Payment object and sends it as a PaymentStatus object on the
-// embedded stream.
-func (i *legacyTrackPaymentServer) Send(p *lnrpc.Payment) error {
- var state PaymentState
- switch p.Status {
- case lnrpc.Payment_IN_FLIGHT:
- state = PaymentState_IN_FLIGHT
- case lnrpc.Payment_SUCCEEDED:
- state = PaymentState_SUCCEEDED
- case lnrpc.Payment_FAILED:
- switch p.FailureReason {
- case lnrpc.PaymentFailureReason_FAILURE_REASON_NONE:
- return fmt.Errorf("expected fail reason")
-
- case lnrpc.PaymentFailureReason_FAILURE_REASON_TIMEOUT:
- state = PaymentState_FAILED_TIMEOUT
-
- case lnrpc.PaymentFailureReason_FAILURE_REASON_NO_ROUTE:
- state = PaymentState_FAILED_NO_ROUTE
-
- case lnrpc.PaymentFailureReason_FAILURE_REASON_ERROR:
- state = PaymentState_FAILED_ERROR
-
- case lnrpc.PaymentFailureReason_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS:
- state = PaymentState_FAILED_INCORRECT_PAYMENT_DETAILS
-
- case lnrpc.PaymentFailureReason_FAILURE_REASON_INSUFFICIENT_BALANCE:
- state = PaymentState_FAILED_INSUFFICIENT_BALANCE
-
- default:
- return fmt.Errorf("unknown failure reason %v",
- p.FailureReason)
- }
- default:
- return fmt.Errorf("unknown state %v", p.Status)
- }
-
- preimage, err := hex.DecodeString(p.PaymentPreimage)
- if err != nil {
- return err
- }
-
- legacyState := PaymentStatus{
- State: state,
- Preimage: preimage,
- Htlcs: p.Htlcs,
- }
-
- return i.Router_TrackPaymentServer.Send(&legacyState)
-}
-
-// TrackPayment returns a stream of payment state updates. The stream is
-// closed when the payment completes.
-func (s *Server) TrackPayment(request *TrackPaymentRequest,
- stream Router_TrackPaymentServer) error {
-
- legacyStream := legacyTrackPaymentServer{
- Router_TrackPaymentServer: stream,
- }
- return s.TrackPaymentV2(request, &legacyStream)
-}
-
-// SendPayment attempts to route a payment described by the passed
-// PaymentRequest to the final destination. If we are unable to route the
-// payment, or cannot find a route that satisfies the constraints in the
-// PaymentRequest, then an error will be returned. Otherwise, the payment
-// pre-image, along with the final route will be returned.
-func (s *Server) SendPayment(request *SendPaymentRequest,
- stream Router_SendPaymentServer) error {
-
- if request.MaxParts > 1 {
- return errors.New("for multi-part payments, use SendPaymentV2")
- }
-
- legacyStream := legacyTrackPaymentServer{
- Router_TrackPaymentServer: stream,
- }
- return s.SendPaymentV2(request, &legacyStream)
-}
-
-// SendToRoute sends a payment through a predefined route. The response of this
-// call contains structured error information.
-func (s *Server) SendToRoute(ctx context.Context,
- req *SendToRouteRequest) (*SendToRouteResponse, error) {
-
- resp, err := s.SendToRouteV2(ctx, req)
- if err != nil {
- return nil, err
- }
-
- if resp == nil {
- return nil, nil
- }
-
- // Need to convert to legacy response message because proto identifiers
- // don't line up.
- legacyResp := &SendToRouteResponse{
- Preimage: resp.Preimage,
- Failure: resp.Failure,
- }
-
- return legacyResp, nil
-}
-
// QueryProbability returns the current success probability estimate for a
// given node pair and amount.
func (s *Server) QueryProbability(_ context.Context,
Why this scored 37/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.