From def4b00a31e817f7948b996dbf27c6908109e3cd Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 10 Aug 2025 12:03:15 +0200 Subject: [PATCH] release the GIL when calling get_coinspends_with_conditions --- wheel/src/api.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wheel/src/api.rs b/wheel/src/api.rs index 9964fb973..70676b986 100644 --- a/wheel/src/api.rs +++ b/wheel/src/api.rs @@ -550,7 +550,8 @@ pub fn get_spends_for_trusted_block<'a>( }) .collect::>(); - let output = get_coinspends_for_trusted_block(constants, &generator, &refs, flags)?; + let output = + py.allow_threads(|| get_coinspends_for_trusted_block(constants, &generator, &refs, flags))?; let dict = PyDict::new(py); dict.set_item("block_spends", output)?; @@ -575,8 +576,9 @@ pub fn get_spends_for_trusted_block_with_conditions<'a>( }) .collect::>(); - let output = - get_coinspends_with_conditions_for_trusted_block(constants, &generator, &refs, flags)?; + let output = py.allow_threads(|| { + get_coinspends_with_conditions_for_trusted_block(constants, &generator, &refs, flags) + })?; let pylist = PyList::empty(py); for (coinspend, cond_output) in output {