1
0
Fork 0
forked from lthn/blockchain

minor fixes in suspicious block time check

This commit is contained in:
sowle 2020-01-28 02:37:54 +03:00
parent 0d72922877
commit 5622ce550b
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
3 changed files with 7 additions and 7 deletions

View file

@ -3909,7 +3909,7 @@ bool blockchain_storage::check_tx_inputs(const transaction& tx, const crypto::ha
const std::vector<crypto::signature>* psig = &sig_stub;
TIME_MEASURE_START_PD(tx_check_inputs_loop);
BOOST_FOREACH(const auto& txin, tx.vin)
for(const auto& txin : tx.vin)
{
if (!m_is_in_checkpoint_zone)
{

View file

@ -880,10 +880,10 @@ namespace currency
}
//@#@
//temporary double check timestamp
if (time(NULL) - get_actual_timestamp(b) > 5)
if (time(NULL) - static_cast<int64_t>(get_actual_timestamp(b)) > 5)
{
LOG_PRINT_RED_L0("Found block (" << get_block_hash(b) << ") timestamp (" << get_actual_timestamp(b)
<< ") is suspiciously less (" << time(NULL) - get_actual_timestamp(b) << ") then curren time( " << time(NULL) << ")");
<< ") is suspiciously less (" << time(NULL) - static_cast<int64_t>(get_actual_timestamp(b)) << ") than current time ( " << time(NULL) << ")");
//mark node to make it easier to find it via scanner
m_core.get_blockchain_storage().get_performnce_data().epic_failure_happend = true;
}
@ -937,10 +937,10 @@ namespace currency
}
//@#@
//temporary double check timestamp
if (time(NULL) - get_actual_timestamp(b) > 5)
if (time(NULL) - static_cast<int64_t>(get_actual_timestamp(b)) > 5)
{
LOG_PRINT_RED_L0("Found block (" << get_block_hash(b) << ") timestamp (" << get_actual_timestamp(b)
<< ") is suspiciously less (" << time(NULL) - get_actual_timestamp(b) << ") then curren time( " << time(NULL) << ")");
<< ") is suspiciously less (" << time(NULL) - static_cast<int64_t>(get_actual_timestamp(b)) << ") than current time ( " << time(NULL) << ")");
//mark node to make it easier to find it via scanner
m_core.get_blockchain_storage().get_performnce_data().epic_failure_happend = true;
}

View file

@ -2899,10 +2899,10 @@ bool wallet2::build_minted_block(const currency::COMMAND_RPC_SCAN_POS::request&
m_wcallback->on_pos_block_found(b);
//@#@
//double check timestamp
if (time(NULL) - get_actual_timestamp(b) > 5)
if (time(NULL) - static_cast<int64_t>(get_actual_timestamp(b)) > 5)
{
WLT_LOG_RED("Found block (" << get_block_hash(b) << ") timestamp (" << get_actual_timestamp(b)
<< ") is suspiciously less (" << time(NULL) - get_actual_timestamp(b) << ") then curren time( " << time(NULL) << ")", LOG_LEVEL_0);
<< ") is suspiciously less (" << time(NULL) - static_cast<int64_t>(get_actual_timestamp(b)) << ") than current time ( " << time(NULL) << ")", LOG_LEVEL_0);
}
//
return true;