1
0
Fork 0
forked from lthn/blockchain

minor fixes

This commit is contained in:
sowle 2022-09-23 18:45:59 +02:00
parent 7d57e8a993
commit 0bfe224b66
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 7 additions and 5 deletions

View file

@ -28,7 +28,8 @@ namespace crypto
size_t len = sizeof h;
std::string s(len * 2, ' ');
for (size_t i = 0; i < len; ++i) {
for (size_t i = 0; i < len; ++i)
{
s[2 * i] = hexmap[data[len - 1 - i] >> 4];
s[2 * i + 1] = hexmap[data[len - 1 - i] & 0x0F];
}
@ -44,7 +45,8 @@ namespace crypto
size_t len = sizeof h;
std::string s(len * 2, ' ');
for (size_t i = 0; i < len; ++i) {
for (size_t i = 0; i < len; ++i)
{
s[2 * i] = hexmap[data[i] >> 4];
s[2 * i + 1] = hexmap[data[i] & 0x0F];
}

View file

@ -4880,7 +4880,7 @@ bool blockchain_storage::check_block_timestamp_main(const block& b) const
}
if (is_pos_block(b) && b.timestamp > get_adjusted_time() + CURRENCY_POS_BLOCK_FUTURE_TIME_LIMIT)
{
LOG_PRINT_L0("Timestamp of PoS block with id: " << get_block_hash(b) << ", " << b.timestamp << ", bigger than adjusted time + " + epee::misc_utils::get_time_interval_string(CURRENCY_POS_BLOCK_FUTURE_TIME_LIMIT) + ": " << get_adjusted_time() << " (" << b.timestamp - get_adjusted_time() << ")");
LOG_PRINT_L0("Timestamp of PoS block with id: " << get_block_hash(b) << ", " << b.timestamp << ", bigger than adjusted time + " + epee::misc_utils::get_time_interval_string(CURRENCY_POS_BLOCK_FUTURE_TIME_LIMIT) + ": " << get_adjusted_time() + CURRENCY_POS_BLOCK_FUTURE_TIME_LIMIT << " (" << b.timestamp - get_adjusted_time() - CURRENCY_POS_BLOCK_FUTURE_TIME_LIMIT << ")");
return false;
}
@ -5590,8 +5590,8 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt
if(!check_block_timestamp_main(bl))
{
LOG_PRINT_L0("Block with id: " << id << ENDL
<< "have invalid timestamp: " << bl.timestamp);
//add_block_as_invalid(bl, id);//do not add blocks to invalid storage befor proof of work check was passed
<< "has invalid timestamp: " << bl.timestamp);
// do not add this block to invalid block list prior to proof of work check
bvc.m_verification_failed = true;
return false;
}