Skip to content

Commit

Permalink
refactor: optimize eth_sendTransaction to exit early if signer not fo…
Browse files Browse the repository at this point in the history
…und (#9494)
  • Loading branch information
Quertyy authored Jul 13, 2024
1 parent ad606bb commit cbe9a7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/rpc/rpc-eth-api/src/helpers/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ pub trait EthTransactions: LoadTransaction {
None => return Err(SignError::NoAccount.into()),
};

if self.find_signer(&from).is_err() {
return Err(SignError::NoAccount.into());
}

// set nonce if not already set before
if request.nonce.is_none() {
let nonce = self.transaction_count(from, Some(BlockId::pending())).await?;
Expand Down

0 comments on commit cbe9a7c

Please sign in to comment.