Skip to content

Commit 01ccf40

Browse files
committed
fix
1 parent 0d8b147 commit 01ccf40

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/rs-context-provider/src/provider.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,10 @@ where
190190
core_chain_locked_height: u32,
191191
) -> Pin<Box<dyn Future<Output = Result<[u8; 48], ContextProviderError>> + Send + 'static>>
192192
{
193-
let lock = self.lock().expect("lock poisoned");
194-
lock.get_quorum_public_key_async(quorum_type, quorum_hash, core_chain_locked_height)
193+
// Compute synchronously under the lock, then return a ready future.
194+
// This avoids holding the MutexGuard across await points which would be unsound.
195+
let result = self.get_quorum_public_key(quorum_type, quorum_hash, core_chain_locked_height);
196+
Box::pin(async move { result })
195197
}
196198

197199
fn get_quorum_public_key(

0 commit comments

Comments
 (0)