add clarifying comment for duplicate instance detection (#30895)

This commit is contained in:
Jeff Biseda 2023-03-30 17:13:41 -07:00 committed by GitHub
parent 32780353c7
commit 5ada25b4e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -441,6 +441,12 @@ impl NodeInstance {
// Returns true if the crds-value is a duplicate instance
// of this node, with a more recent timestamp.
// The older instance is considered the duplicate instance because:
// - If a staked node is restarted it will receive its old instance value
// from gossip. Considering the new instance as the duplicate would
// prevent the node from restarting.
// - Similarly, hotswap relies on the the old instance being considered the
// duplicate instance.
pub(crate) fn check_duplicate(&self, other: &CrdsValue) -> bool {
match &other.data {
CrdsData::NodeInstance(other) => {