Skip to content
Open
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
4 changes: 2 additions & 2 deletions consensus/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ impl ConsensusEngine {
/// ensuring proper depth calculation and three-layer storage management.
pub async fn add_event(&self, event: Event) -> SetuResult<EventId> {
// Update local VLC by merging with the event's VLC
// merge() calls VLCSnapshot::receive() which already does merge + increment
{
let mut vlc = self.vlc.write().await;
vlc.merge(&event.vlc_snapshot);
vlc.tick();
}

// Add event through DagManager with retry (handles TOCTOU race with GC)
Expand Down Expand Up @@ -352,10 +352,10 @@ impl ConsensusEngine {
/// Unlike `add_event`, this does not broadcast the event again to avoid message loops.
pub async fn receive_event_from_network(&self, event: Event) -> SetuResult<EventId> {
// Update local VLC by merging with the event's VLC
// merge() calls VLCSnapshot::receive() which already does merge + increment
{
let mut vlc = self.vlc.write().await;
vlc.merge(&event.vlc_snapshot);
vlc.tick();
}

// Add event through DagManager with retry (handles TOCTOU race with GC)
Expand Down