Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure transactions are finalized so outputs are available in the ledger update store #1381

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/analytics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
//! Various analytics that give insight into the usage of the tangle.

use futures::{prelude::stream::StreamExt, TryStreamExt};
use iota_sdk::types::block::{
output::OutputId,
payload::SignedTransactionPayload,
protocol::ProtocolParameters,
slot::{EpochIndex, SlotCommitment, SlotIndex},
Block,
use iota_sdk::types::{
api::core::TransactionState,
block::{
output::OutputId,
payload::SignedTransactionPayload,
protocol::ProtocolParameters,
slot::{EpochIndex, SlotCommitment, SlotIndex},
Block,
},
};
use thiserror::Error;

Expand Down Expand Up @@ -324,7 +327,9 @@ impl<'a, I: InputSource> Slot<'a, I> {
.and_then(|p| p.as_signed_transaction_opt())
.zip(data.transaction)
{
self.handle_transaction(analytics, payload, &metadata, &ctx).await?;
if metadata.transaction_state == Some(TransactionState::Finalized) {
self.handle_transaction(analytics, payload, &metadata, &ctx).await?;
}
}
self.handle_block(analytics, &data.block, &ctx).await?;
}
Expand Down
Loading