Skip to content

Commit b0e1a72

Browse files
committed
routerrpc: add check for empty hops
1 parent 452db01 commit b0e1a72

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lnrpc/routerrpc/router_server.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,10 @@ func (s *Server) trackPaymentStream(context context.Context,
14011401
func (s *Server) BuildRoute(_ context.Context,
14021402
req *BuildRouteRequest) (*BuildRouteResponse, error) {
14031403

1404+
if len(req.HopPubkeys) == 0 {
1405+
return nil, errors.New("no hops specified")
1406+
}
1407+
14041408
// Unmarshall hop list.
14051409
hops := make([]route.Vertex, len(req.HopPubkeys))
14061410
for i, pubkeyBytes := range req.HopPubkeys {

0 commit comments

Comments
 (0)