MCPcopy Create free account
hub / github.com/base/base / remove

Method remove

crates/execution/txpool/src/invalidation.rs:227–241  ·  view source on GitHub ↗

Removes `hash` from the index, unlinking it from each of its watched keys and pruning any key bucket left empty. Returns the transaction's watch set if it was present.

(&mut self, hash: &TxHash)

Source from the content-addressed store, hash-verified

225 /// keys and pruning any key bucket left empty. Returns the transaction's
226 /// watch set if it was present.
227 pub fn remove(&mut self, hash: &TxHash) -> Option<WatchSet> {
228 let watch = self.watch_sets.remove(hash)?;
229 for key in watch.keys() {
230 if let Some(bucket) = self.by_key.get_mut(key) {
231 bucket.remove(hash);
232 if bucket.is_empty() {
233 self.by_key.remove(key);
234 if let InvalidationKey::ExpiryBucket(bucket) = key {
235 self.expiry_buckets.remove(bucket);
236 }
237 }
238 }
239 }
240 Some(watch)
241 }
242
243 /// Returns `true` if `hash` is registered.
244 #[must_use]

Calls 3

keysMethod · 0.45
get_mutMethod · 0.45
is_emptyMethod · 0.45