mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-05 21:53:12 +02:00
routerrpc: add check for empty hops
This commit is contained in:
@@ -1401,6 +1401,10 @@ func (s *Server) trackPaymentStream(context context.Context,
|
|||||||
func (s *Server) BuildRoute(_ context.Context,
|
func (s *Server) BuildRoute(_ context.Context,
|
||||||
req *BuildRouteRequest) (*BuildRouteResponse, error) {
|
req *BuildRouteRequest) (*BuildRouteResponse, error) {
|
||||||
|
|
||||||
|
if len(req.HopPubkeys) == 0 {
|
||||||
|
return nil, errors.New("no hops specified")
|
||||||
|
}
|
||||||
|
|
||||||
// Unmarshall hop list.
|
// Unmarshall hop list.
|
||||||
hops := make([]route.Vertex, len(req.HopPubkeys))
|
hops := make([]route.Vertex, len(req.HopPubkeys))
|
||||||
for i, pubkeyBytes := range req.HopPubkeys {
|
for i, pubkeyBytes := range req.HopPubkeys {
|
||||||
|
Reference in New Issue
Block a user