diff --git a/daemon/lightningd.c b/daemon/lightningd.c index 0afd0f2cf..382c280b8 100644 --- a/daemon/lightningd.c +++ b/daemon/lightningd.c @@ -29,6 +29,8 @@ static struct lightningd_state *lightningd_state(void) list_head_init(&state->peers); timers_init(&state->timers, time_now()); + state->secpctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY + | SECP256K1_CONTEXT_SIGN); return state; } diff --git a/daemon/lightningd.h b/daemon/lightningd.h index a14bdc02a..64c6f58c8 100644 --- a/daemon/lightningd.h +++ b/daemon/lightningd.h @@ -3,6 +3,7 @@ #include "config.h" #include #include +#include #include /* Here's where the global variables hide! */ @@ -21,5 +22,8 @@ struct lightningd_state { /* Our peers. */ struct list_head peers; + + /* Crypto tables for global use. */ + secp256k1_context *secpctx; }; #endif /* LIGHTNING_DAEMON_LIGHTNING_H */