fix invalid nodeinfo check

This commit is contained in:
John Smith 2023-12-07 10:28:26 -05:00 committed by Christien Rioux
parent ac6aa8f2eb
commit 99fb135b5b
3 changed files with 11 additions and 3 deletions

View File

@ -647,6 +647,11 @@ impl BucketEntryInner {
return false;
}
// If we have had any lost answers recently, this is not reliable
if self.peer_stats.rpc_stats.recent_lost_answers > 0 {
return false;
}
match self.peer_stats.rpc_stats.first_consecutive_seen_ts {
// If we have not seen seen a node consecutively, it can't be reliable
None => false,

View File

@ -962,7 +962,10 @@ impl RoutingTableInner {
None => has_valid_own_node_info,
Some(entry) => entry.with_inner(|e| {
e.signed_node_info(routing_domain)
.map(|sni| sni.has_any_signature())
.map(|sni| {
sni.has_any_signature()
&& !matches!(sni.node_info().network_class(), NetworkClass::Invalid)
})
.unwrap_or(false)
}),
}

View File

@ -723,14 +723,14 @@ impl StorageManager {
let dest = rpc_processor
.resolve_target_to_destination(
vc.target,
vc.target.clone(),
SafetySelection::Unsafe(Sequencing::NoPreference),
)
.await
.map_err(VeilidAPIError::from)?;
network_result_value_or_log!(rpc_processor
.rpc_call_value_changed(dest, vc.key, vc.subkeys, vc.count, (*vc.value).clone())
.rpc_call_value_changed(dest, vc.key, vc.subkeys.clone(), vc.count, (*vc.value).clone())
.await
.map_err(VeilidAPIError::from)? => [format!(": dest={:?} vc={:?}", dest, vc)] {
});