Hopefully this is more thread-safe

This commit is contained in:
Peter Conrad 2015-03-11 17:42:49 +01:00
parent d69e67c032
commit 10897adf1e

View file

@ -1,12 +1,13 @@
namespace detail
{
static int init_secp256k1() {
secp256k1_start(SECP256K1_START_VERIFY | SECP256K1_START_SIGN);
return 1;
}
static void init_lib() {
static int init_s = 0;
static int init_s = init_secp256k1();
static int init_o = init_openssl();
if (!init_s) {
secp256k1_start(SECP256K1_START_VERIFY | SECP256K1_START_SIGN);
init_s = 1;
}
}
void public_key_impl::free_key()