fix signed node info
This commit is contained in:
parent
9f917af767
commit
60c4648530
@ -181,6 +181,8 @@ impl BucketEntryInner {
|
|||||||
|
|
||||||
// See if we have an existing signed_node_info to update or not
|
// See if we have an existing signed_node_info to update or not
|
||||||
if let Some(current_sni) = opt_current_sni {
|
if let Some(current_sni) = opt_current_sni {
|
||||||
|
// Always allow overwriting invalid/unsigned node
|
||||||
|
if current_sni.has_valid_signature() {
|
||||||
// If the timestamp hasn't changed or is less, ignore this update
|
// If the timestamp hasn't changed or is less, ignore this update
|
||||||
if signed_node_info.timestamp <= current_sni.timestamp {
|
if signed_node_info.timestamp <= current_sni.timestamp {
|
||||||
// If we received a node update with the same timestamp
|
// If we received a node update with the same timestamp
|
||||||
@ -197,6 +199,7 @@ impl BucketEntryInner {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update the protocol min/max version we have
|
// Update the protocol min/max version we have
|
||||||
self.min_max_version = Some((
|
self.min_max_version = Some((
|
||||||
|
@ -149,7 +149,6 @@ impl RPCProcessor {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
opt_sender_info = Some(sender_info.clone());
|
|
||||||
}
|
}
|
||||||
SendDataKind::Indirect => {
|
SendDataKind::Indirect => {
|
||||||
// Do nothing in this case, as the socket address returned here would be for any node other than ours
|
// Do nothing in this case, as the socket address returned here would be for any node other than ours
|
||||||
@ -158,6 +157,7 @@ impl RPCProcessor {
|
|||||||
// Do nothing in this case, as an existing connection could not have a different public address or it would have been reset
|
// Do nothing in this case, as an existing connection could not have a different public address or it would have been reset
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
opt_sender_info = Some(sender_info.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user