From b7b999eb73162e545dd3942cc364b5d6bf993d27 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Fri, 1 Nov 2024 22:29:19 +0100 Subject: [PATCH] fix: don't randomize the global context twice --- src/context.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/context.rs b/src/context.rs index 6ad7addcf..c10b8404d 100644 --- a/src/context.rs +++ b/src/context.rs @@ -46,17 +46,7 @@ pub mod global { static ONCE: Once = Once::new(); static mut CONTEXT: Option> = None; ONCE.call_once(|| unsafe { - let mut ctx = Secp256k1::new(); - #[cfg(all( - not(target_arch = "wasm32"), - feature = "rand", - feature = "std", - not(feature = "global-context-less-secure") - ))] - { - ctx.randomize(&mut rand::thread_rng()); - } - CONTEXT = Some(ctx); + CONTEXT = Some(Secp256k1::new()); }); unsafe { CONTEXT.as_ref().unwrap() } }