From 685f3d79927b93c12fcbfacc19cd8e1a56815e8c Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Tue, 23 Apr 2024 12:06:01 +0800 Subject: [PATCH] Fix cargo clippy suggestions --- rpc/src/module/pool.rs | 2 +- tx-pool/src/process.rs | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/rpc/src/module/pool.rs b/rpc/src/module/pool.rs index fb702e74c6d..b365fa2d892 100644 --- a/rpc/src/module/pool.rs +++ b/rpc/src/module/pool.rs @@ -466,7 +466,7 @@ impl PoolRpcImpl { &self.well_known_lock_scripts, &self.well_known_type_scripts, ) - .validate(&tx), + .validate(tx), } { return Err(RPCError::custom_with_data( RPCError::PoolRejectedTransactionByOutputsValidator, diff --git a/tx-pool/src/process.rs b/tx-pool/src/process.rs index 815ca3a76b8..39627ccf9a9 100644 --- a/tx-pool/src/process.rs +++ b/tx-pool/src/process.rs @@ -877,10 +877,7 @@ impl TxPoolService { let (pre_check_ret, snapshot) = self.pre_check(&tx).await; - let (_tip_hash, rtx, status, _fee, _tx_size) = match pre_check_ret { - Ok(ret_ok) => ret_ok, - Err(err) => return Err(err.into()), - }; + let (_tip_hash, rtx, status, _fee, _tx_size) = pre_check_ret?; // skip check the delay window @@ -889,14 +886,13 @@ impl TxPoolService { let tip_header = snapshot.tip_header(); let tx_env = Arc::new(status.with_env(tip_header)); - let verified_ret = verify_rtx( + verify_rtx( Arc::clone(&snapshot), Arc::clone(&rtx), tx_env, &verify_cache, max_cycles, - ); - verified_ret + ) } pub(crate) async fn update_tx_pool_for_reorg(