From 462d0e74cee32442fbadf1b255f9a9dae035d7cd Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Mon, 20 Jun 2022 23:10:13 -0400 Subject: [PATCH] Pre-allocate the distribution --- coins/monero/src/wallet/decoys.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coins/monero/src/wallet/decoys.rs b/coins/monero/src/wallet/decoys.rs index 38ae071f..dbba42f7 100644 --- a/coins/monero/src/wallet/decoys.rs +++ b/coins/monero/src/wallet/decoys.rs @@ -20,7 +20,7 @@ const DECOYS: usize = RING_LEN - 1; lazy_static! { static ref GAMMA: Gamma = Gamma::new(19.28, 1.0 / 1.61).unwrap(); - static ref DISTRIBUTION: Mutex> = Mutex::new(vec![]); + static ref DISTRIBUTION: Mutex> = Mutex::new(Vec::with_capacity(3000000)); } async fn select_n(