diff --git a/common/utils.c b/common/utils.c index f51094f41..01047ea57 100644 --- a/common/utils.c +++ b/common/utils.c @@ -1,4 +1,5 @@ #include "config.h" +#include #include #include #include @@ -99,6 +100,8 @@ void setup_locale(void) /* Initial creation of tmpctx. */ void setup_tmpctx(void) { + /* Don't call me twice! */ + assert(!tmpctx); tmpctx = tal_arr_label(NULL, char, 0, "tmpctx"); } diff --git a/devtools/route.c b/devtools/route.c index d13e3cf9d..90a7de058 100644 --- a/devtools/route.c +++ b/devtools/route.c @@ -28,9 +28,6 @@ static struct route_hop *least_cost(struct gossmap *map, struct route_hop *path; struct timemono tstart, tstop; - setup_locale(); - setup_tmpctx(); - tstart = time_mono(); dij = dijkstra(tmpctx, map, dst, sent, riskfactor, route_can_carry, diff --git a/openingd/dualopend.c b/openingd/dualopend.c index 9ac43d87a..159a418aa 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -4334,7 +4334,7 @@ static void fetch_per_commitment_point(u32 point_count, int main(int argc, char *argv[]) { - common_setup(argv[0]); + setup_locale(); struct pollfd pollfd[2]; struct state *state = tal(NULL, struct state);