Skip to content

Commit

Permalink
Record clues in transaction action handler
Browse files Browse the repository at this point in the history
  • Loading branch information
cronokirby committed May 15, 2024
1 parent 6885b18 commit 60891da
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/core/app/src/action_handler/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use anyhow::Result;
use async_trait::async_trait;
use cnidarium::{StateRead, StateWrite};
use penumbra_sct::{component::source::SourceContext, CommitmentSource};
use penumbra_shielded_pool::component::ClueManager;
use penumbra_transaction::Transaction;
use tokio::task::JoinSet;
use tracing::{instrument, Instrument};
Expand Down Expand Up @@ -105,6 +106,18 @@ impl AppActionHandler for Transaction {
// Delete the note source, in case someone else tries to read it.
state.put_current_source(None);

// Record all the clues in this transaction
// To avoid recomputing a hash.
let id = self.id();
for clue in self
.transaction_body
.detection_data
.iter()
.flat_map(|x| x.fmd_clues.iter())
{
state.record_clue(clue.clone(), id.clone()).await?;
}

Ok(())
}
}
Expand Down

0 comments on commit 60891da

Please sign in to comment.