MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / new

Method new

ipld/resolver/src/provider_cache.rs:44–52  ·  view source on GitHub ↗
(max_subnets: usize, static_subnets: Vec<SubnetID>)

Source from the content-addressed store, hash-verified

42
43impl SubnetProviderCache {
44 pub fn new(max_subnets: usize, static_subnets: Vec<SubnetID>) -> Self {
45 Self {
46 pinned_subnets: HashSet::from_iter(static_subnets),
47 max_subnets,
48 routable_peers: Default::default(),
49 subnet_providers: Default::default(),
50 peer_timestamps: Default::default(),
51 }
52 }
53
54 /// Pin a subnet, after which it won't be pruned.
55 pub fn pin_subnet(&mut self, subnet_id: SubnetID) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected