mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf: drop lock early (#5016)
This commit is contained in:
@ -159,15 +159,17 @@ where
|
||||
let hash = *transaction.hash();
|
||||
let (tx, rx) = oneshot::channel();
|
||||
{
|
||||
let res = {
|
||||
let to_validation_task = self.to_validation_task.clone();
|
||||
let to_validation_task = to_validation_task.lock().await;
|
||||
let validator = self.validator.clone();
|
||||
let res = to_validation_task
|
||||
to_validation_task
|
||||
.send(Box::pin(async move {
|
||||
let res = validator.validate_transaction(origin, transaction).await;
|
||||
let _ = tx.send(res);
|
||||
}))
|
||||
.await;
|
||||
.await
|
||||
};
|
||||
if res.is_err() {
|
||||
return TransactionValidationOutcome::Error(
|
||||
hash,
|
||||
|
||||
Reference in New Issue
Block a user