mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-07 14:00:08 +02: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:
@ -421,10 +421,13 @@ func TestChannelUpdateValidation(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
route := NewRouteFromHops(
|
||||
route, err := NewRouteFromHops(
|
||||
lnwire.MilliSatoshi(10000), 100,
|
||||
NewVertex(ctx.aliases["a"]), hops,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to create route: %v", err)
|
||||
}
|
||||
|
||||
// Set up a channel update message with an invalid signature to be
|
||||
// returned to the sender.
|
||||
|
Reference in New Issue
Block a user