mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 13:25:43 +01:00
routing: Fix for single hop routes segfaulting.
The first hop is being stripped from computed routes, however the first channel of the route is being used to get our peer address. This results in segfaults if the route is just one hop, i.e., has no first channel to get the peer's address from. Fixed by simply using an existing pointer to our peer.
This commit is contained in:
parent
72a9cfbbe2
commit
754616c45a
@ -278,7 +278,7 @@ struct peer *find_route(struct lightningd_state *dstate,
|
|||||||
assert(n == src);
|
assert(n == src);
|
||||||
|
|
||||||
/* We should only add routes if we have a peer. */
|
/* We should only add routes if we have a peer. */
|
||||||
first = find_peer(dstate, &(*route)[0]->src->id);
|
first = find_peer(dstate, &dst->id);
|
||||||
if (!first) {
|
if (!first) {
|
||||||
log_broken_struct(dstate->base_log, "No peer %s?",
|
log_broken_struct(dstate->base_log, "No peer %s?",
|
||||||
struct pubkey, &(*route)[0]->src->id);
|
struct pubkey, &(*route)[0]->src->id);
|
||||||
|
Loading…
Reference in New Issue
Block a user