You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
implRelationsStoreforDbRelationsStore{/// See `insert_batch` as well/// TODO: use one function with DbWriter for both this function and insert_batchfninsert(&self,hash:Hash,parents:BlockHashes) -> Result<(),StoreError>{ifself.has(hash)? {returnErr(StoreError::KeyAlreadyExists(hash.to_string()));}// Insert a new entry for `hash`self.parents_access.write(DirectDbWriter::new(&self.db), hash, parents.clone())?;// The new hash has no children yetself.children_access.write(DirectDbWriter::new(&self.db),
hash,BlockHashes::new(Vec::new()),)?;// Update `children` for each parentfor parent in parents.iter().cloned(){letmut children = (*self.get_children(parent)?).clone();
children.push(hash);self.children_access.write(DirectDbWriter::new(&self.db),
parent,BlockHashes::new(children),)?;}Ok(())}}
self.parents_access.write and self.children_access.write are two steps.
The data might be inconsistent if self.children_access.write fails and self.parents_access.write succeeds.
The text was updated successfully, but these errors were encountered:
Bug Report
self.parents_access.write and self.children_access.write are two steps.
The data might be inconsistent if self.children_access.write fails and self.parents_access.write succeeds.
The text was updated successfully, but these errors were encountered: