putVerified

fun putVerified(expected: BobbinHash, bytes: ByteArray)

Re-hashes bytes and verifies that the result matches expected, then stores the bytes. Throws IllegalArgumentException if the hash does not match — a content-addressing invariant violation indicating tampered or corrupt bytes.

This is the verify-on-insert step described in the design: a peer that received bytes from a neighbour calls this to confirm what it fetched before caching it.

Throws

if hash(bytes) != expected.