mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-18 06:34:27 +01:00
routing: check for empty hops list
This commit fixes a crash that could be triggered by sending an empty hop list to the SendToRoute rpc.
This commit is contained in:
@@ -3848,12 +3848,15 @@ func (r *rpcServer) unmarshallRoute(rpcroute *lnrpc.Route,
|
||||
prevNodePubKey = routeHop.PubKeyBytes
|
||||
}
|
||||
|
||||
route := routing.NewRouteFromHops(
|
||||
route, err := routing.NewRouteFromHops(
|
||||
lnwire.MilliSatoshi(rpcroute.TotalAmtMsat),
|
||||
rpcroute.TotalTimeLock,
|
||||
sourceNode.PubKeyBytes,
|
||||
hops,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return route, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user