From d8294401cd63a7d07641e469d3d3f485a29f3f0a Mon Sep 17 00:00:00 2001 From: James Hunsaker Date: Fri, 25 Aug 2023 15:15:03 -0400 Subject: [PATCH] thread local secp256k1 context --- lib/silkpre/precompile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/silkpre/precompile.cpp b/lib/silkpre/precompile.cpp index a508de4..ac799e8 100644 --- a/lib/silkpre/precompile.cpp +++ b/lib/silkpre/precompile.cpp @@ -67,7 +67,7 @@ SilkpreOutput silkpre_ecrec_run(const uint8_t* input, size_t len) { } std::memset(out, 0, 12); - static secp256k1_context* context{secp256k1_context_create(SILKPRE_SECP256K1_CONTEXT_FLAGS)}; + thread_local secp256k1_context* context{secp256k1_context_create(SILKPRE_SECP256K1_CONTEXT_FLAGS)}; if (!silkpre_recover_address(out + 12, &d[0], &d[64], v != 27, context)) { return {out, 0}; }