Skip to content

Commit

Permalink
add tx count
Browse files Browse the repository at this point in the history
  • Loading branch information
wphan committed Apr 22, 2024
1 parent 345752b commit 18ce01a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/grpc_geyser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,18 @@ impl GrpcGeyserImpl {
Ok(Some(message)) => match message.update_oneof {
Some(UpdateOneof::Block(block)) => {
let block_time = block.block_time.unwrap().timestamp;
for transaction in block.transactions {
for transaction in &block.transactions {
let signature =
Signature::new(&transaction.signature).to_string();
signature_cache.insert(signature, (block_time, Instant::now()));
}
tracing::info!(
"grpc_block_received: {}",
"grpc_block_received: {}, with {} transactions",
SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
.unwrap()
.as_secs()
.as_secs(),
block.transactions.len()
);
}
Some(UpdateOneof::Ping(_)) => {
Expand Down

0 comments on commit 18ce01a

Please sign in to comment.