feat(stages): unwind on detached local head (#3066)

This commit is contained in:
Roman Krasiuk
2023-06-09 20:35:46 +03:00
committed by GitHub
parent b414eee015
commit 1ff26dd2fd
14 changed files with 262 additions and 134 deletions

View File

@ -247,6 +247,13 @@ pub fn validate_header_regarding_parent(
})
}
if parent.hash != child.parent_hash {
return Err(ConsensusError::ParentHashMismatch {
expected_parent_hash: parent.hash,
got_parent_hash: child.parent_hash,
})
}
// timestamp in past check
if child.timestamp <= parent.timestamp {
return Err(ConsensusError::TimestampIsInPast {