Skip to content

Commit

Permalink
Validate block timestamps
Browse files Browse the repository at this point in the history
Reject blocks with timestamp too far in the future
Backport from BitShares: bitshares/bitshares-core#17
  • Loading branch information
BhuzOr committed Jun 4, 2017
1 parent 4a75af7 commit 83f9e46
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libraries/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ namespace detail {
{ try {

auto latency = graphene::time::now() - blk_msg.block.timestamp;
FC_ASSERT( (latency.count()/1000) > -5000, "Rejecting block with timestamp in the future" );
if (!sync_mode || blk_msg.block.block_num() % 10000 == 0)
{
const auto& witness = blk_msg.block.witness(*_chain_db);
Expand Down

0 comments on commit 83f9e46

Please sign in to comment.