checkpoint

This commit is contained in:
John Smith
2022-11-09 22:27:37 -05:00
parent e672ae0319
commit 592c83d83a
10 changed files with 299 additions and 325 deletions

View File

@@ -336,10 +336,14 @@ impl RPCProcessor {
//////////////////////////////////////////////////////////////////////
/// Determine if a NodeInfo can be placed into the specified routing domain
fn filter_node_info(&self, routing_domain: RoutingDomain, node_info: &NodeInfo) -> bool {
/// Determine if a SignedNodeInfo can be placed into the specified routing domain
fn filter_node_info(
&self,
routing_domain: RoutingDomain,
signed_node_info: &SignedNodeInfo,
) -> bool {
let routing_table = self.routing_table();
routing_table.node_info_is_valid_in_routing_domain(routing_domain, &node_info)
routing_table.signed_node_info_is_valid_in_routing_domain(routing_domain, &signed_node_info)
}
//////////////////////////////////////////////////////////////////////
@@ -619,7 +623,7 @@ impl RPCProcessor {
// routing table caching when it is okay to do so
// This is only done in the PublicInternet routing domain because
// as far as we can tell this is the only domain that will really benefit
fn get_sender_signed_node_info(&self, dest: &Destination) -> Option<SignedDirectNodeInfo> {
fn get_sender_signed_node_info(&self, dest: &Destination) -> Option<SignedNodeInfo> {
// Don't do this if the sender is to remain private
// Otherwise we would be attaching the original sender's identity to the final destination,
// thus defeating the purpose of the safety route entirely :P

View File

@@ -50,10 +50,7 @@ impl RPCProcessor {
// Verify peers are in the correct peer scope
for peer_info in &find_node_a.peers {
if !self.filter_node_info(
RoutingDomain::PublicInternet,
&peer_info.signed_node_info.node_info,
) {
if !self.filter_node_info(RoutingDomain::PublicInternet, &peer_info.signed_node_info) {
return Err(RPCError::invalid_format(
"find_node response has invalid peer scope",
));

View File

@@ -11,7 +11,8 @@ impl RPCProcessor {
// Get the signed node info for the desired routing domain to send update with
let signed_node_info = self
.routing_table()
.get_own_signed_node_info(routing_domain);
.get_own_peer_info(routing_domain)
.signed_node_info;
let node_info_update = RPCOperationNodeInfoUpdate { signed_node_info };
let statement = RPCStatement::new(RPCStatementDetail::NodeInfoUpdate(node_info_update));
@@ -50,7 +51,7 @@ impl RPCProcessor {
};
// Update our routing table with signed node info
if !self.filter_node_info(routing_domain, &node_info_update.signed_node_info.node_info) {
if !self.filter_node_info(routing_domain, &node_info_update.signed_node_info) {
log_rpc!(debug "node info doesn't belong in {:?} routing domain: {}", routing_domain, sender_node_id);
return Ok(());
}