Skip to content

Commit

Permalink
::nit
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDhejavu committed Dec 11, 2024
1 parent c5051f2 commit 1b66059
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 1 addition & 3 deletions crates/rpc/rpc/src/eth/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,7 @@ where
/// Broadcasts raw transaction if there are active subscribers.
#[inline]
pub fn broadcast_raw_transaction(&self, raw_tx: Bytes) {
if self.raw_tx_sender.send(raw_tx).is_err() {
trace!("no receivers for raw transaction");
}
let _ = self.raw_tx_sender.send(raw_tx);
}
}

Expand Down
7 changes: 4 additions & 3 deletions crates/rpc/rpc/src/eth/helpers/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ where
/// Returns the hash of the transaction.
async fn send_raw_transaction(&self, tx: Bytes) -> Result<B256, Self::Error> {
let recovered = recover_raw_transaction(&tx)?;

// broadcast raw transaction to subscribers if there is any.
self.broadcast_raw_transaction(tx);

let pool_transaction = <Self::Pool as TransactionPool>::Transaction::from_pooled(recovered);

// submit the transaction to the pool with a `Local` origin
Expand All @@ -35,9 +39,6 @@ where
.await
.map_err(Self::Error::from_eth_err)?;

// broadcast raw transaction to subscribers if there is any.
self.broadcast_raw_transaction(tx);

Ok(hash)
}
}
Expand Down

0 comments on commit 1b66059

Please sign in to comment.