Browse Source

routing: don't coredump on routes to neighbors.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
79b5663db7
  1. 4
      daemon/routing.c

4
daemon/routing.c

@ -321,6 +321,8 @@ struct peer *find_route(struct lightningd_state *dstate,
msatoshi += *fee; msatoshi += *fee;
log_info(dstate->base_log, "find_route:"); log_info(dstate->base_log, "find_route:");
log_add_struct(dstate->base_log, "via %s", struct pubkey, first->id); log_add_struct(dstate->base_log, "via %s", struct pubkey, first->id);
/* If there are intermidiaries, dump them, and total fees. */
if (best != 0) {
for (i = 0; i < best; i++) { for (i = 0; i < best; i++) {
log_add_struct(dstate->base_log, " %s", log_add_struct(dstate->base_log, " %s",
struct pubkey, &(*route)[i]->dst->id); struct pubkey, &(*route)[i]->dst->id);
@ -332,7 +334,7 @@ struct peer *find_route(struct lightningd_state *dstate,
} }
log_add(dstate->base_log, "=%"PRIi64"(%+"PRIi64")", log_add(dstate->base_log, "=%"PRIi64"(%+"PRIi64")",
(*route)[best-1]->dst->bfg[best-1].total, *fee); (*route)[best-1]->dst->bfg[best-1].total, *fee);
}
return first; return first;
} }

Loading…
Cancel
Save