mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-29 09:08:05 -05:00
fix(txpool): use default account if non existing (#2015)
This commit is contained in:
@@ -230,30 +230,18 @@ where
|
||||
.latest()
|
||||
.and_then(|state| state.basic_account(transaction.sender()))
|
||||
{
|
||||
Ok(account) => account,
|
||||
Ok(account) => account.unwrap_or_default(),
|
||||
Err(err) => return TransactionValidationOutcome::Error(transaction, Box::new(err)),
|
||||
};
|
||||
|
||||
let account = match account {
|
||||
Some(account) => {
|
||||
// Signer account shouldn't have bytecode. Presence of bytecode means this is a
|
||||
// smartcontract.
|
||||
if account.has_bytecode() {
|
||||
return TransactionValidationOutcome::Invalid(
|
||||
transaction,
|
||||
InvalidTransactionError::SignerAccountHasBytecode.into(),
|
||||
)
|
||||
} else {
|
||||
account
|
||||
}
|
||||
}
|
||||
None => {
|
||||
return TransactionValidationOutcome::Invalid(
|
||||
transaction,
|
||||
InvalidPoolTransactionError::AccountNotFound,
|
||||
)
|
||||
}
|
||||
};
|
||||
// Signer account shouldn't have bytecode. Presence of bytecode means this is a
|
||||
// smartcontract.
|
||||
if account.has_bytecode() {
|
||||
return TransactionValidationOutcome::Invalid(
|
||||
transaction,
|
||||
InvalidTransactionError::SignerAccountHasBytecode.into(),
|
||||
)
|
||||
}
|
||||
|
||||
// Checks for nonce
|
||||
if transaction.nonce() < account.nonce {
|
||||
|
||||
Reference in New Issue
Block a user