daemon: add global secp256k1 context for easy access.

This caches the tables, so you're not supposed to regenerate it all
the time.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-01-22 06:41:48 +10:30
parent 2df28021ac
commit 14cbcd467f
2 changed files with 6 additions and 0 deletions

View File

@@ -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;
}