Skip to content

Commit

Permalink
NODE-2609 Forge only better challenging blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mashonskii committed Oct 2, 2023
1 parent 24fe4fc commit 32068f6
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ class BlockChallengerImpl(
allAccounts <- getChallengingAccounts(challengedBlock.sender.toAddress)
(acc, delay) <- pickBestAccount(allAccounts)
blockTime = prevBlockHeader.timestamp + delay
_ <- Either.cond(
blockTime < challengedBlock.header.timestamp,
(),
GenericError(s"Challenging block timestamp ($blockTime) is not better than challenged block timestamp (${challengedBlock.header.timestamp})")
)
consensusData <-
pos.consensusData(
acc,
Expand Down

0 comments on commit 32068f6

Please sign in to comment.