mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-09 23:38:10 -05:00
feat(flashblocks): support eth_getBlockTransactionCount for flashblocks (#20291)
Co-authored-by: lucas <66681646+limyeechern@users.noreply.github.com> Co-authored-by: lucas.lim <lucas.lim@okg.com>
This commit is contained in:
@@ -74,7 +74,11 @@ pub trait EthBlocks: LoadBlock<RpcConvert: RpcConvert<Primitives = Self::Primiti
|
||||
block_id: BlockId,
|
||||
) -> impl Future<Output = Result<Option<usize>, Self::Error>> + Send {
|
||||
async move {
|
||||
// If no pending block from provider, build the pending block locally.
|
||||
if block_id.is_pending() {
|
||||
if let Some(pending) = self.local_pending_block().await? {
|
||||
return Ok(Some(pending.block.body().transaction_count()));
|
||||
}
|
||||
// Pending block can be fetched directly without need for caching
|
||||
return Ok(self
|
||||
.provider()
|
||||
|
||||
Reference in New Issue
Block a user