mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(pool): max init code error (#13564)
This commit is contained in:
@ -196,7 +196,7 @@ pub enum InvalidPoolTransactionError {
|
||||
ExceedsGasLimit(u64, u64),
|
||||
/// Thrown when a new transaction is added to the pool, but then immediately discarded to
|
||||
/// respect the `max_init_code_size`.
|
||||
#[error("transaction's size {0} exceeds max_init_code_size {1}")]
|
||||
#[error("transaction's input size {0} exceeds max_init_code_size {1}")]
|
||||
ExceedsMaxInitCodeSize(usize, usize),
|
||||
/// Thrown if the input data of a transaction is greater
|
||||
/// than some meaningful limit a user might use. This is not a consensus error
|
||||
|
||||
@ -1133,11 +1133,9 @@ pub trait PoolTransaction:
|
||||
&self,
|
||||
max_init_code_size: usize,
|
||||
) -> Result<(), InvalidPoolTransactionError> {
|
||||
if self.is_create() && self.input().len() > max_init_code_size {
|
||||
Err(InvalidPoolTransactionError::ExceedsMaxInitCodeSize(
|
||||
self.size(),
|
||||
max_init_code_size,
|
||||
))
|
||||
let input_len = self.input().len();
|
||||
if self.is_create() && input_len > max_init_code_size {
|
||||
Err(InvalidPoolTransactionError::ExceedsMaxInitCodeSize(input_len, max_init_code_size))
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user