Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Slixe committed Dec 31, 2024
2 parents 829f5eb + 4559fd6 commit 8bbd55b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 0 additions & 11 deletions xelis_daemon/src/core/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1671,17 +1671,6 @@ impl<S: Storage> Blockchain<S> {
return Err(BlockchainError::InvalidReachability)
}

if version >= BlockVersion::V2 {
// Verify that the tips are well sorted by cumulative difficulty
let sorted_tips = blockdag::sort_tips(storage, block.get_tips().iter().cloned()).await?;
for (expected, got) in sorted_tips.iter().zip(block.get_tips().iter()) {
if expected != got {
debug!("Invalid tips order, expected {} but got {} for this block {}", expected, got, block_hash);
return Err(BlockchainError::InvalidTipsOrder(block_hash, expected.clone(), got.clone()))
}
}
}

for hash in block.get_tips() {
let previous_timestamp = storage.get_timestamp_for_block_hash(hash).await?;
// block timestamp can't be less than previous block.
Expand Down
2 changes: 1 addition & 1 deletion xelis_daemon/src/core/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub enum BlockchainError {
ContractAlreadyExists,
#[error("Contract not found: {}", _0)]
ContractNotFound(Hash),
#[error("Invalid ip order for block {}, expected {}, got {}", _0, _1, _2)]
#[error("Invalid tip order for block {}, expected {}, got {}", _0, _1, _2)]
InvalidTipsOrder(Hash, Hash, Hash),
#[error("commit point already started")]
CommitPointAlreadyStarted,
Expand Down

0 comments on commit 8bbd55b

Please sign in to comment.