Skip to content

Commit

Permalink
Exclude notes from the compact block if the exclusion flag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
zbuc committed May 16, 2024
1 parent cc342c9 commit 9bfd6bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/core/component/compact-block/src/component/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ trait Inner: StateWrite {
let note_payloads = self
.pending_note_payloads()
.into_iter()
// Filter out notes with the compact block exclusion flag set.
.filter(|(_pos, note, _source)| !note.sync_exclude)
// Strip the sources of transaction IDs
.map(|(pos, note, source)| (pos, (note, source.stripped()).into()));
let rolled_up_payloads = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ impl ActionHandler for Spend {

let source = state.get_current_source().expect("source should be set");

// TODO: if the request body has the "don't store in compact block" bit set,
// then we should not store this nullifier in the compact block.
state.nullify(self.body.nullifier, source).await;

// Also record an ABCI event for transaction indexing.
Expand Down

0 comments on commit 9bfd6bb

Please sign in to comment.