forked from lthn/blockchain
minor fixes
This commit is contained in:
parent
7d57e8a993
commit
0bfe224b66
2 changed files with 7 additions and 5 deletions
|
|
@ -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];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue