MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / is_vertex_zombie

Function is_vertex_zombie

atomic-core/src/output/alive/retrieve/classify.rs:121–135  ·  view source on GitHub ↗

Check if a node is a zombie (deleted but with live connections). A zombie node has at least one deleted block parent edge, meaning something explicitly deleted it. Uses typed [`ParentEdgeKind`] matching for clarity.

(
    txn: &T,
    node: &GraphNode<NodeId>,
)

Source from the content-addressed store, hash-verified

119/// something explicitly deleted it. Uses typed [`ParentEdgeKind`]
120/// matching for clarity.
121pub(super) fn is_vertex_zombie<T: GraphTxnT>(
122 txn: &T,
123 node: &GraphNode<NodeId>,
124) -> Result<bool, PristineError> {
125 // Include deleted edges so we can see deletion markers
126 let parents = txn.iter_parents(*node, true)?;
127
128 for parent in &parents {
129 if parent.kind == ParentEdgeKind::BlockDeleted {
130 return Ok(true); // Has a deleted block parent = zombie
131 }
132 }
133
134 Ok(false)
135}

Callers 1

create_alive_vertexFunction · 0.85

Calls 1

iter_parentsMethod · 0.80

Tested by

no test coverage detected