pub struct ReadOnlyNetworkGraph<'a> {
channels: RwLockReadGuard<'a, IndexedMap<u64, ChannelInfo>>,
nodes: RwLockReadGuard<'a, IndexedMap<NodeId, NodeInfo>>,
+ max_node_counter: u32,
}
/// Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
ReadOnlyNetworkGraph {
channels,
nodes,
+ max_node_counter: (self.next_node_counter.load(Ordering::Acquire) as u32).saturating_sub(1),
}
}
self.nodes.get(&NodeId::from_pubkey(&pubkey))
.and_then(|node| node.announcement_info.as_ref().map(|ann| ann.addresses().to_vec()))
}
+
+ /// Gets the maximum possible node_counter for a node in this graph
+ pub(crate) fn max_node_counter(&self) -> u32 {
+ self.max_node_counter
+ }
}
#[cfg(test)]