Skip to content

Commit

Permalink
Merge #760: fix: don't randomize the global context twice
Browse files Browse the repository at this point in the history
b7b999e fix: don't randomize the global context twice (DaniPopes)

Pull request description:

  Closes #759.

ACKs for top commit:
  apoelstra:
    ACK b7b999e; successfully ran local tests; thanks!

Tree-SHA512: 6f82befb20c062460f08af01d6664f6c2013c23adaa2462aabf2ab8fd19afe08d53d9b155bc8c306abecf4a0bbc5b350c997b23f675bca05ea5df435ffe980b1
  • Loading branch information
apoelstra committed Nov 2, 2024
2 parents bb4972f + b7b999e commit 728e3a8
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,7 @@ pub mod global {
static ONCE: Once = Once::new();
static mut CONTEXT: Option<Secp256k1<All>> = 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() }
}
Expand Down

0 comments on commit 728e3a8

Please sign in to comment.