Skip to content

Commit

Permalink
fix: use replacement transaction hash in PoolError (#6898)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected authored Feb 29, 2024
1 parent 907d8ff commit 2df0d91
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/transaction-pool/src/pool/txpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,10 @@ impl<T: TransactionOrdering> TxPool<T> {
// Update invalid transactions metric
self.metrics.invalid_transactions.increment(1);
match err {
InsertErr::Underpriced { existing, transaction: _ } => {
Err(PoolError::new(existing, PoolErrorKind::ReplacementUnderpriced))
}
InsertErr::Underpriced { existing: _, transaction } => Err(PoolError::new(
*transaction.hash(),
PoolErrorKind::ReplacementUnderpriced,
)),
InsertErr::FeeCapBelowMinimumProtocolFeeCap { transaction, fee_cap } => {
Err(PoolError::new(
*transaction.hash(),
Expand Down Expand Up @@ -1725,8 +1726,8 @@ pub(crate) type InsertResult<T> = Result<InsertOk<T>, InsertErr<T>>;
pub(crate) enum InsertErr<T: PoolTransaction> {
/// Attempted to replace existing transaction, but was underpriced
Underpriced {
#[allow(dead_code)]
transaction: Arc<ValidPoolTransaction<T>>,
#[allow(dead_code)]
existing: TxHash,
},
/// Attempted to insert a blob transaction with a nonce gap
Expand Down

0 comments on commit 2df0d91

Please sign in to comment.