Skip to content

Commit

Permalink
gossipd/test/run-bench-find_route: don't abort if we try to route to …
Browse files Browse the repository at this point in the history
…ourselves

This would fail, and we'd free an uninitialized pointer.

Also, add us to .gitignore and clear up a comment.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Dec 20, 2017
1 parent 3543530 commit bb601a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions gossipd/test/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
run-find_route
run-bench-find_route
4 changes: 2 additions & 2 deletions gossipd/test/run-bench-find_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static void populate_random_node(struct routing_state *rstate, u64 n)
{
struct pubkey id = nodeid(n);

/* Create up to 2 random channels. */
/* Create 2 random channels. */
if (n < 1)
return;

Expand Down Expand Up @@ -189,7 +189,7 @@ int main(int argc, char *argv[])
struct pubkey from = nodeid(pseudorand(num_nodes));
struct pubkey to = nodeid(pseudorand(num_nodes));
u64 fee;
struct node_connection **route, *nc;
struct node_connection **route = NULL, *nc;

nc = find_route(ctx, rstate, &from, &to,
pseudorand(100000),
Expand Down

0 comments on commit bb601a1

Please sign in to comment.