forked from lthn/blockchain
minor fixes in suspicious block time check
This commit is contained in:
parent
0d72922877
commit
5622ce550b
3 changed files with 7 additions and 7 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue