Skip to content

Commit

Permalink
node: Call preverify(tx) after basic checks pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Goshawk committed Aug 8, 2024
1 parent 22a32de commit a9dd36a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions node/src/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ impl MempoolSrv {
vm: &Arc<RwLock<VM>>,
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
Expand All @@ -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
Expand Down

0 comments on commit a9dd36a

Please sign in to comment.