Skip to content

Commit 8618677

Browse files
committed
Make the validator to refuse the block that has the same timestamp with the parent
1 parent f0cac4d commit 8618677

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/verification/verification.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ fn verify_parent(header: &Header, parent: &Header) -> Result<(), Error> {
201201
found: *header.parent_hash(),
202202
})))
203203
}
204-
if header.timestamp() < parent.timestamp() {
204+
if header.timestamp() <= parent.timestamp() {
205205
return Err(From::from(BlockError::InvalidTimestamp(OutOfBounds {
206206
max: None,
207-
min: Some(parent.timestamp()),
207+
min: Some(parent.timestamp() + 1),
208208
found: header.timestamp(),
209209
})))
210210
}

0 commit comments

Comments
 (0)