diff --git a/tx-pool/src/util.rs b/tx-pool/src/util.rs index fa1ca7546..1ab7d2895 100644 --- a/tx-pool/src/util.rs +++ b/tx-pool/src/util.rs @@ -99,6 +99,13 @@ pub(crate) async fn verify_rtx( .map(|_| *completed) .map_err(Reject::Verification) } else if let Some(command_rx) = command_rx { + DaoScriptSizeVerifier::new( + Arc::clone(&rtx), + snapshot.cloned_consensus(), + snapshot.as_data_loader(), + ) + .verify() + .map_err(Reject::Verification)?; ContextualTransactionVerifier::new( Arc::clone(&rtx), consensus, @@ -107,25 +114,18 @@ pub(crate) async fn verify_rtx( ) .verify_with_pause(max_tx_verify_cycles, command_rx) .await - .and_then(|result| { - DaoScriptSizeVerifier::new(rtx, snapshot.cloned_consensus(), snapshot.as_data_loader()) - .verify()?; - Ok(result) - }) .map_err(Reject::Verification) } else { block_in_place(|| { - ContextualTransactionVerifier::new(Arc::clone(&rtx), consensus, data_loader, tx_env) + DaoScriptSizeVerifier::new( + Arc::clone(&rtx), + snapshot.cloned_consensus(), + snapshot.as_data_loader(), + ) + .verify() + .map_err(Reject::Verification)?; + ContextualTransactionVerifier::new(rtx, consensus, data_loader, tx_env) .verify(max_tx_verify_cycles, false) - .and_then(|result| { - DaoScriptSizeVerifier::new( - rtx, - snapshot.cloned_consensus(), - snapshot.as_data_loader(), - ) - .verify()?; - Ok(result) - }) .map_err(Reject::Verification) }) }