mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
routerrpc: add check for empty hops
This commit is contained in:
parent
452db01ad7
commit
b0e1a722c6
1 changed files with 4 additions and 0 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue