From a9dd36a0f763b8b77ea6996e3abc995ae989dba0 Mon Sep 17 00:00:00 2001 From: Goshawk Date: Thu, 8 Aug 2024 16:40:53 +0300 Subject: [PATCH] node: Call preverify(tx) after basic checks pass --- node/src/mempool.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/node/src/mempool.rs b/node/src/mempool.rs index cc60f864e0..62497a2b11 100644 --- a/node/src/mempool.rs +++ b/node/src/mempool.rs @@ -111,11 +111,6 @@ impl MempoolSrv { vm: &Arc>, tx: &Transaction, ) -> Result<(), TxAcceptanceError> { - // VM Preverify call - if let Err(e) = vm.read().await.preverify(tx) { - Err(TxAcceptanceError::VerificationFailed(format!("{e:?}")))?; - } - let tx_id = tx.id(); // Perform basic checks on the transaction @@ -138,6 +133,11 @@ impl MempoolSrv { Ok(()) })?; + // VM Preverify call + if let Err(e) = vm.read().await.preverify(tx) { + Err(TxAcceptanceError::VerificationFailed(format!("{e:?}")))?; + } + // Try to add the transaction to the mempool db.read().await.update(|db| { let nullifiers: Vec<_> = tx