MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / handle_delta

Method handle_delta

nodedb/src/control/array_sync/inbound.rs:162–180  ·  view source on GitHub ↗

Handle a single delta message from a Lite peer.

(
        &self,
        msg: &ArrayDeltaMsg,
    )

Source from the content-addressed store, hash-verified

160
161 /// Handle a single delta message from a Lite peer.
162 pub async fn handle_delta(
163 &self,
164 msg: &ArrayDeltaMsg,
165 ) -> Result<InboundOutcome, Option<ArrayRejectMsg>> {
166 let op = match op_codec::decode_op(&msg.op_payload) {
167 Ok(op) => op,
168 Err(e) => {
169 warn!(array = %msg.array, error = %e, "array_inbound: delta decode failed");
170 return Err(Some(build_reject(
171 &msg.array,
172 Hlc::ZERO,
173 ArrayRejectReason::ShapeInvalid,
174 format!("decode error: {e}"),
175 )));
176 }
177 };
178
179 self.apply_op(op, &msg.op_payload).await
180 }
181
182 /// Handle a batch of delta messages from a Lite peer.
183 ///

Calls 3

decode_opFunction · 0.85
build_rejectFunction · 0.85
apply_opMethod · 0.80