if node_delta.has_address_set_changed {
node_address_update_count += 1;
- let address_set = &node_delta.latest_details_after_seen.as_ref().unwrap().addresses;
+ let address_set = &node_delta.latest_details.as_ref().unwrap().addresses;
let mut address_serialization = Vec::new();
// we don't know a priori how many are <= 255 bytes
if node_delta.has_feature_set_changed {
node_feature_update_count += 1;
- let latest_features = &node_delta.latest_details_after_seen.as_ref().unwrap().features;
+ let latest_features = &node_delta.latest_details.as_ref().unwrap().features;
// are these features among the most common ones?
if let Some(index) = serialization_details.node_announcement_feature_defaults.iter().position(|f| f == latest_features) {
pub(super) struct NodeDelta {
/// The most recently received, but new-to-the-client, node details
- pub(super) latest_details_after_seen: Option<NodeDetails>,
+ pub(super) latest_details: Option<NodeDetails>,
/// Between last_details_before_seen and latest_details_after_seen, including any potential
/// intermediate updates that are not kept track of here, has the set of features this node
impl Default for NodeDelta {
fn default() -> Self {
Self {
- latest_details_after_seen: None,
+ latest_details: None,
has_feature_set_changed: false,
has_address_set_changed: false,
last_details_before_seen: None,
}
if !is_previously_processed_node_id {
- (*current_node_delta).latest_details_after_seen.get_or_insert(NodeDetails {
+ (*current_node_delta).latest_details.get_or_insert(NodeDetails {
seen: current_seen_timestamp,
features: unsigned_node_announcement.features,
addresses: address_set,
let mut node_feature_histogram: HashMap<&NodeFeatures, usize> = Default::default();
for (_id, delta) in serialization_set.node_mutations.iter() {
if delta.has_feature_set_changed || delta.last_details_before_seen.is_none() {
- if let Some(latest_details) = delta.latest_details_after_seen.as_ref() {
+ if let Some(latest_details) = delta.latest_details.as_ref() {
*node_feature_histogram.entry(&latest_details.features).or_insert(0) += 1;
};
}